哪位高手能用curl或file_get_contents擷取這個網頁的內容

來源:互聯網
上載者:User
誰能用curl或file_get_contents擷取這個網頁的內容?
http://zhaohongen.fu.cn8u.cn/v.html
如果能請不方法告訴我,不勝感激!!

------解決方案--------------------
他這是有一個點擊後的跳轉,不是自己寫了個header跳轉.
看了一下代碼 其實就是掩人耳目

使用curl來訪問。只需要 第一次訪問這個頁面儲存好cookie 再重新整理一次頁面 帶上cookie 即可.
完全使用cookie 來控制,試我就不試了

你可以在瀏覽器先開啟 http://zhaohongen.fu.cn8u.cn/v.html 再開啟一個tab 然後訪問 http://zhaohongen.fu.cn8u.cn/v.html

內容就出來了,清除掉cookie 就又不行了 又得重複上面我說的步驟,所以只要控制了cookie就可以了

------解決方案--------------------
真糾結,,妞妞都說了,cookie問題
PHP code
$cookie_file = dirname(__FILE__).'/cookie.txt';if(!file_exists($cookie_file)){    $fp= fopen($cookie_file,"w");    fclose($fp);}$url = "http://zhaohongen.fu.cn8u.cn/v.html";$ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIEJAR,  $cookie_file); curl_exec($ch);curl_close($ch);$url = "http://zhaohongen.fu.cn8u.cn/v.html";$ch = curl_init($url);curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); $response = curl_exec($ch);curl_close($ch);echo $response; 
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.