Answer the question
In order to leave comments, you need to log in
The parser does not work with a certain wanderer, why?
Why is parsing not working from this page?? - https://soccer365.ru/games/921770/
From the page - https://soccer365.ru/ everything is ok
Not working
$url = 'https://soccer365.ru/games/921770/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "GOOGLE"); // Обманочка
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
$url = 'https://soccer365.ru/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "GOOGLE"); // Обманочка
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
Answer the question
In order to leave comments, you need to log in
Nah, that's how it works)
$context = stream_context_create(
[
'http' => [
'method' => 'GET',
'header' => "path: /games/921770/\r\n" .
"User-agent: Mozilla/5.0 (Linux; Android 4.4.4; HM NOTE 1LTEW Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36 MicroMessenger/6.0.0.54_r849063.501 NetType/WIFI\r\n",
'ignore_errors' => true,
],
]
);
$request = file_get_contents(
'https://soccer365.ru/games/921770/',
false,
$context
);
die(print_r($request));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "GOOGLE"); // Обманочка
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
echo '<pre>';
print_r( curl_getinfo($ch) );
echo '</pre>';
curl_close($ch);
echo $output;
Array
(
[url] => https://soccer365.ru/games/921770/
[content_type] => text/html; charset=UTF-8
[http_code] => 301
[header_size] => 539
[request_size] => 84
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.255368
[namelookup_time] => 0.000614
[connect_time] => 0.02999
[pretransfer_time] => 0.19802
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => 0
[upload_content_length] => 0
[starttransfer_time] => 0.25531
[redirect_time] => 0
[redirect_url] => https://soccer365.ru//soccer365.ru/live/match-etyir-1924-levski-smotret-onlayn/
[primary_ip] => 51.15.25.134
[certinfo] => Array
(
)
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question