Частый гость
Покинул форум
Сообщений всего: 198
Дата рег-ции: Май 2012
Помог: 0 раз(а)
|
При парсинге страницы через Curl выдает ошибку 403 forbidden, а если использовать file_get_contents то все нормально. Парсю http://history[dot]radiorecord[dot]ru/ai[dot][dot][dot]club/2016-03-16/
PHP:
скопировать код в буфер обмена
function curl($url = '', $post = '', $referer = '', $proxy = '') { //curl_setopt($cl, CURLOPT_ENCODING, 'gzip, deflate'); //curl_setopt($cl, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($cl, CURLOPT_COOKIEJAR , $this->cookieFile); curl_setopt($cl, CURLOPT_COOKIEFILE , $this->cookieFile); } else { } } else { } } //$ex = iconv('cp1251','UTF8',$ex); return $ex; }
|