我正在开发一个 Node js 应用程序,我正在使用 x 射线抓取一个网站,我认为我的 IP 地址被阻止了,那么我该如何配置代理或隐藏我的 IP 地址呢?这是我的代码:
var Xray = require('x-ray');
var x = Xray()
x('https://www.myurl.com', {
title: x('#cm_cr-review_list .a-section.review', [{,
blogs:"..a-text-bold"
}]),
})
.paginate('li.a-l a@href')
.write('result.json')
最佳答案
我不认为有一些代理支持。
也许试试这个(没有 xray)
var request = require('superagent');
require('superagent-proxy')
(request);
request
.get('http://google.com/')
.proxy('socks://localhost:9050')
.end(function(err, res) {
if (err) throw err;
console.log(res.text);
})
关于javascript - 将代理添加到 X Ray Node JS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48206040/