我正在使用 node.io 构建一个网络抓取工具,但在寻找实现方法的过程中,我提出了很多要求,但该网站阻止了我。我不知道如何添加代理,例如使用 Tor 向该网站发出请求。
最佳答案
我安装了tor和polipo。 Polipo 连接到 Tor 和 Node.IO 将使用 polipo 提供的 http 代理。 看起来比我想象的简单。 并为scraper设置代理
var scrap = new Scraper({
start: 0,
limit: 5,
count: null,
max: config.max || 0,
debug: true,
wait: 3,
proxy: 'http://127.0.0.1:8123'
});
效果很好。
关于node.js - 使用node.io抓取时如何添加像Tor这样的代理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19221903/