$url = "https://razmerkoles.ru/size/bmw/8-series/2019/";
function getCurlResult ($url) {
global $arrProxy;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLPROTO_HTTPS,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, "103.239.54.56:45462");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);// таймаут в секундах
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134');
// curl_setopt($ch, CURLOPT_VERBOSE, true);
// curl_setopt($ch, CURLOPT_COOKIEJAR, "/var/www/docs/lobochkin.ru/cookies");
// curl_setopt($ch, CURLOPT_COOKIEFILE, "/var/www/docs/lobochkin.ru/cookies");
$htmltext = curl_exec($ch);
curl_close($ch);
//$htmltext = iconv("CP1251", "UTF-8", $htmltext);
return $htmltext;
}
$zz = 0;
$html = getCurlResult($url);
preg_match('/sRwd=\'(.*?)\'/', $html, $m);
$str = $m[1];
echo $str . "<br>";
$url_site = "https://razmerkoles.ru";
$str_curl_code = getCurlResult($url_site . $str);
// $curl_code = file_get_contents($url_site . $str);
echo "<pre>";
echo $str_curl_code . "<br>";
echo "</pre>";
HTTP/1.1 200 OK
HTTP/1.1 200 OK
Cache-Control: max-age=0, no-cache, no-store, must-revalidate, post-check=0, pre-check=0
Content-Language: ru
Content-Type: text/html; charset=utf-8
Date: Wed, 30 Jan 2019 11:13:39 GMT
ETag: "35c3d93cb207a3413d4c9d16a3f819f9"
Pragma: no-cache
Server: nginx
Strict-Transport-Security: max-age=31536000; includeSubDomains;
Vary: Accept-Encoding
Vary: Accept-Language, Cookie
X-Cache-Status: HIT
X-Frame-Options: SAMEORIGIN
X-Page-Speed: 1.12.34.3-0
X-Server: WEB PROD / 1
Content-Length: 636
Connection: keep-alive
EYi0n2y2zgeIoIaItte0ihGGms4YnsiSiciWzwi4otGIoIaIstySierPzxnLBciSiciZnwvKytKIoIaIstySierPzxnLBciSiciYmtnLzwmIoIaIiIWGiJe3odrLnYi6ici3nc4Xig1TiIWGiMy0mdrJmsi6ici3nc4Xig1TiIWGiJq5yZzJnci6icjjnIWGrgLLC2vSiIWGiJu0owe0zIi6ici3nc4Xig1TiIWGiJy4odrHysi6icjnmtqGEcaXlJi1iIWGiJLJndK0mIi6icjnmtqGEcaXlJi1iIWGiJrMmtLJmci6ici3nc4Xig1TiIWGiMu1zgmXzIi6ici3nc4Xig1TiIWGiJC4zwq2nsi6icjwocWGxhuWndeXxhuWndm1xhuWndnKxhuWndm3xhuWndm4xhuWndnKiIWGiJzLmJi2nsi6icjnmtqGEcaXlJi1iIWGiJiXmwyXmIi6iciIlcaInZbHnJDLiJOGiKK2lcbCDta0mtfCDta0mZvCDta0m2rCDta0mZDCDta0mZHCDta0m2qIlcaIzduZnZm3iJOGiIiSici2odiWmMeIoIaItte0ihGGms4YnsiSiciWzJC2odeIoIaIiIWGiJi1zdu4mYi6iciIFq--
<?php
require_once 'pr-24.12.2018/simple_html_dom.php';
ini_set('memory_limit', '500M');
$url = "https://razmerkoles.ru";
function getCurlResult ($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLPROTO_HTTPS,1);
$htmltext = curl_exec($ch);
curl_close($ch);
//$htmltext = iconv("CP1251", "UTF-8", $htmltext);
return $htmltext;
}
$zz = 0;
$urlYear = 'https://razmerkoles.ru/size/peugeot/308/2013/';
$html3 = str_get_html(getCurlResult($urlYear));
$htmlArr3 = $html3->find('#vehicle-market-data .vehicle-market'); // массив внутренних рынков
if(count($htmlArr3) != 1) {// проверка есть ли разделения на внутренние рынки
foreach ($htmlArr3 as $key => $div) {
// echo $div->outertext . "<br>";
$market = $html3->find('#vehicle-market-data .vehicle-market h4', $key)->plaintext; // выводит название внутреннего рынка
echo $market . "<br>" . $urlYear . "<br>";
foreach ($div->find('.modification-item') as $modifications) {
$sizeBoltСipher = $modifications->find('tbody', 0)->attr['data-vehicle'];
}
}
} else { //если нет разделения на внутренние рынки
}
$html3->clear(); // подчищаем за собой
unset($html3);