aspx頁面會跳轉,PHP怎麼file_get_content()進行追蹤採集

來源:互聯網
上載者:User
aspx頁面會跳轉,PHP如何file_get_content()進行追蹤採集?
搜尋索引鍵「39000038」,
http://www.mouser.cn/Search/Refine.aspx?Keyword=39000038
因為僅有一款,頁面會自動跳轉到
http://www.mouser.cn/ProductDetail/Molex/39-00-0038/?qs=%2fha2pyFaduicta8SJW6uUsrinUHZLSGN9RfyeL103Gs%3d

搜尋索引鍵「3900003」,有多款產品是一個列表
http://www.mouser.cn/Search/Refine.aspx?Keyword=3900003

我想知道,它是直接在.net中直接判斷然後跳轉的,還是用js判斷跳轉的

我要用php的file_get_content()函數抓取
http://www.mouser.cn/Search/Refine.aspx?Keyword=39000038
如何才能跟蹤到
http://www.mouser.cn/ProductDetail/Molex/39-00-0038/?qs=%2fha2pyFaduicta8SJW6uUsrinUHZLSGN9RfyeL103Gs%3d
------解決方案--------------------
file_get_contents 是辦不到的
function curl_get($durl) {
$t = parse_url($durl);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$durl);
curl_setopt($ch, CURLOPT_TIMEOUT,5);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_REFERER, "http://$t[host]/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$r = curl_exec($ch);
curl_close($ch);
return $r;
}

echo curl_get( 'http://www.mouser.cn/Search/Refine.aspx?Keyword=39000038');
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.