【发布时间】:2013-05-30 08:05:11
【问题描述】:
这是我使用http://whatismyipaddress.com/proxy-check检查IP地址的代码
var casper = require("casper").create(),
utils = require('utils');
casper.userAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0');
casper.start("http://whatismyipaddress.com/proxy-check", function() {
this.capture('0.png');
});
casper.on('remote.message', function(msg) {
this.echo('Remote: ' + msg);
})
casper.run(function() {
this.echo('End');
//finish execution script
this.exit();
});
我输入了casperjs --proxy="xxx.xxx.xxx.xxx:80" proxy.js
但截图正是我机器的IP地址。
那么我怎么知道代理是坏的还是我的代码或命令行有问题?
【问题讨论】:
-
我运行了你的代码,它对我来说很好,当我使用代理时,我得到了不同的屏幕截图。代理是否需要身份验证?
标签: node.js proxy web-scraping phantomjs casperjs