我使用cheerio和惡夢的節點包從「Yelp.com」進行爬取。我從Yelp.com檢索數據。 但yelp已經阻止了我的IP。 請任何一個都可以提供解決方案或suggestions.Thanks提前如何抓取yelp.com上的數據而無需阻止我們的IP
這裏是我的代碼,因爲正在從中似乎是在同一臺服務器的IP地址產生的所有請求
var Nightmare = require('nightmare');
var fs = require('fs');
var http = require('http');
var cheerio = require('cheerio');
var request = require('request');
function yelpmenuitemsscrap(url)
{
// console.log(url);
var menuitems = new Nightmare();
menuitems.goto(url);
menuitems.wait();
menuitems.evaluate(function() {
var objs = [];
$('div.menu-sections div.media-block.menu-
item').each(function(index){
objs.push($(this).find('div.media-story h4').text().trim());
});
return objs;
},function (html) {});
menuitems.run(function(err, nightmare) {
if (err)
{
return console.log(err);
}
else
{
console.log(nightmare);
};
});
}
有關可用來創建代理服務器和在線使用它們滿足您的要求的現成的軟件工具。在「軟件代理服務器」上進行一些谷歌搜索,你會罰款符合你的要求。 –
我嘗試過創建多個代理servers.But但我沒有得到。您能否請我提供示例代碼以創建代理服務器及其用法 – siva
感謝您的建議 – siva