T
T
thesirvlad2021-06-18 16:29:05
PHP
thesirvlad, 2021-06-18 16:29:05

How to parse odds on the site?

The site from which you need to parse coefficients - csgorun.pro
There is such a code

function curlGetPage ($url, $referer = 'https://google.com/')
{
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 ');
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_REFERER, $referer);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $response = curl_exec($ch);
  curl_close($ch);

  return $response;
}


echo curlGetPage('https://csgorun.pro/');

When outputting, it doesn’t want to show anything, having learned a little information, I came to the conclusion that there is a ban on the site, but how to get around it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question