为nodejs模块PhantomJS配置代理
PhantomJS模块配置代理方案一:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
phantom.create(["--proxy=201.172.242.184:15124", "--proxy-type=socks5"]) .then((instance) => { phInstance = instance; return instance.createPage(); }) .then((page) => { sitepage = page; return page.open('http://newsdaily.online'); }) .then((status) => { console.log(status); return sitepage.property('title'); }) .then((content) => { console.log(content); sitepage.close(); phInstance.exit(); }) .catch((error) => { console.log(error); phInstance.exit(); }); |
PhantomJS模块配置代理方案二: Continue reading