我想用cURL訪問http://www.bbb.org/us/Find-Business-Reviews/的數據現在我使用HTTPFox來查看此站點發送的數據並作出相應的陣列,以「POST」的頁面,但我有在訪問第2,3,4,5問題...cURL錯誤 - 「無法解析主機:www.bbb.org(;沒有請求類型的數據記錄」
這裏是陣列 -
$array = Array();
$array['__EVENTTARGET'] = 'ctl12$gc1$s$gridResults$ctl23$pagerLinkButton2';
$array['__EVENTARGUMENT'] = '';
$array['__LASTFOCUS'] = '';
$array['__VIEWSTATEFIELDCOUNT'] = 6;
$array['__VIEWSTATE'] = $View_state;
$array['__VIEWSTATE1'] = $View_state1;
$array['__VIEWSTATE2'] = $View_state2;
$array['__VIEWSTATE3'] = $View_state3;
$array['__VIEWSTATE4'] = $View_state4;
$array['__VIEWSTATE5'] = $View_state5;
$array['ctl12$qn$quickSearch'] = "";
$array['ctl12$qn$TextBoxWatermarkExtender1_ClientState'] = "";
$array['ctl12$gc1$s$txtSearch'] = "tax";
$array['ctl12$gc1$s$CityTextBox'] = "";
$array['ctl12$gc1$s$ddlState'] = "";
$array['ctl12$gc1$s$ZipTextBox'] = 10292;
$array['ctl12$gc1$s$ddlSort'] = "SCORE DESC";
但我總是得到相同的錯誤 -
「Could not re解決主持人:www.bbb.org(;請鍵入」
這裏沒有數據記錄是我使用
function cURL($url, $header=NULL, $p=NULL) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, $header);
curl_setopt($ch, CURLOPT_NOBODY, $header);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
if ($p) {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $p);
}
$result = curl_exec($ch);
if ($result) {
return $result;
} else {
return curl_error($ch);
}
curl_close($ch);
}
不是這是發生相同的錯誤。我複製粘貼它! – Shubham 2010-07-19 10:53:07
更明確:這不是一個有效的域名:) – Wrikken 2010-07-19 10:55:15
@所有 - 但我發送初始請求到該網站,然後它正在工作,它顯示廣告,問題是隻有當我試圖訪問2,3,4, 5 ...頁。 – Shubham 2010-07-19 10:58:35