Good afternoon, dear forum users! I had this problem. When developing one site, I encountered such a problem as the impossibility of transferring data from another site.

I use this function:

$docHTML = file_get_contents($url); 

And it works for all sites except one http://www.banki.ru/banks/ratings/

For some reason, the parser data is not returned from this site, I don’t even know what to do with it. Tell me how to overcome this problem. Php version 5.4. Maybe the library for the site parser, even those that are protected from third-party robots.

  • Just checked - everything works. What exactly did you fail? Describe in more detail what they did, what they expected to see and what they actually received. - Johny
  • @Johny, Well, there’s a site instead of $ url, I’m writing some google or third-party site, it’s all output, and I’m starting to display this site and nothing. Maybe a ban on the ip-address from the frequent parsing of data from that site? Is it possible? - IntegralAL
  • Check from your host: wget -S http://www.banki.ru/banks/ratings/ - user6550
  • Look at the response code. Try using wget, for example, and see what it writes. - Johny

1 answer 1

I tried to run:

 $url = 'http://www.banki.ru/banks/ratings/'; $docHTML = file_get_contents($url); echo $docHTML; 

I returned the contents of the landing page.

Option with curl_proxy

 $url = 'http://www.banki.ru/banks/ratings/'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_PROXY, '176.114.202.232:3128'); $html = curl_exec ($ch); curl_close($ch); echo $html; 

List of proxies here

  • Well, there is a site instead of $ url writing some Google or third-party site displays everything, and I begin to display this site and nothing. Maybe a ban on the ip-address from the frequent parsing of data from that site? Is it possible? - IntegralAL
  • Quite possible. Use curl_proxy if you need so much. Updated your answer. - terantul