如何抓取網頁即時內容

來源:互聯網
上載者:User
#網址:http://data.shishicai.cn/cqssc/haoma/#Demo:>".print_r($pages);echo PHP_EOL;$doc = new DOMDocument();$new_doc = new DOMDocument('1.0', 'utf-8');echo "doc-->>".print_r($doc);echo PHP_EOL;$dom = $doc->getElementsByTagName('table');$newdoc = $new_doc->loadhtml($dom->item(2)->nodeValue);$table = $new_doc->saveHTML();echo "table-->>{$table}".PHP_EOL;#result:#……亂碼……#pages-->>1 DOMDocument Object ( ) doc-->>1 table-->>#table是空的……?>


回複討論(解決方案)

我想擷取的內容是:

對應程式碼片段:

頁面資料是JS填充的。你得爬那個JS指令碼。

貌似這樣做繁瑣了吧?

貌似是用了frame架構內嵌在tbody裡面,然後用JS代碼來做html。
開啟http://datacache.shishicai.cn/script/2f67117ba1b58074.js後,
搜尋'frame'出來6條結果
憑我的技術分析是不出架構的連結

LZ看來也是位大神,技術分好高,仰望ING

http://data.shishicai.cn/handler/kuaikai/data.ashx
post: lottery=4&date=2013-05-06
採集這兒.

樓上連結抓的是空白……

  • 聯繫我們

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