How to capture real-time webpage content
# Website: 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 :#...... Garbled ...... # Pages --> 1 DOMDocument Object () doc --> 1 table --> # table is empty...?>
Reply to discussion (solution)
What I want to obtain is:
Corresponding code snippet:
Page data is filled by JS. You have to crawl the JS script.
It seems complicated to do this, right?
It seems that the frame framework is embedded in the tbody, and then html is made using JS code.
Open http://datacache.shishicai.cn/script/2f67117ba1b58074.js,
Search for 6 results in 'framework '.
Based on my technical analysis, there is no reference to the framework.
LZ seems to be a great player, with a high technical score. looking forward to ING
Http://data.shishicai.cn/handler/kuaikai/data.ashx
Post: lottery = 4 & date = 2013-05-06
Collect here.
The link above is blank ......