Answer the question
In order to leave comments, you need to log in
Bans when parsing (too many requests). How to fix?
<?php
require_once('../phpQuery/phpQuery.php');
require_once('../curl.php');
require_once('../simple_html_dom.php');
$curl = new Curl();
$res = $curl->get('http://www.bestchange.ru/qiwi-to-ripple.html');
$doc = phpQuery::newDocument($res->body);
$changes = $doc->find('div#rates_block table#content_table tr');
foreach ($changes as $change) {
$pq = pq($change);
}
?>
How to make sure that the site is not banned when parsing? Answer the question
In order to leave comments, you need to log in
Added CURL.
$ch = curl_init('http://www.bestchange.ru/qiwi-to-zcash.html');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_PROXY, '188.130.134.13:46546'); // есть список proxy
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_close($ch);
Write what kind of site at least?
and in what way does it ban? maybe, for example, it gives a captcha for solving - in this case, you can use the rucaptcha recognition services.
or change ip if it doesn't help...
+ you can reduce the speed of parsing - then it might be better too.
tin) well, there is an api there that gives the zip file ... one said about the proxy, and away we go ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question