I cant understand how to using proxies in phantomjs, i tried
phantomjs example.js --proxy="ip:port"
phantomjs example.js --proxy=ip:port
phantomjs example.js --proxy=ip:port --proxy-type=http
but i see only my ip=(
No any output, also if proxy ip apriori invalid.
example.js:
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.onLoadFinished = function(status){
if (!status){
console.log('fail');
phantom.exit();
}
page.render("1.png");
phantom.exit();
};
page.open("http://whoer.net/");
what obvious thing i forgot? Thanks.
As i said i forgot one obvious thing - arguments for phantomjs must be after command "phantomjs" not after script name. Correct variant:
phantomjs --proxy=ip:port example.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With