simple_html_dom timer?
I am trying to g开发者_JAVA技巧et the contents of a webpage but the page loads in 2 times.
there seems to be some kind of timer, at first it loads some content and then after 10 seconds it loads the other part of the content that have the content that i am trying to get.
Is there a way to achieve this?
Ty ;)
You need to use a headless browser engine to do this. cURL and wget are HTTP libraries; they speak HTTP and download documents as text. They don't have a concept of a DOM or a JavaScript engine that would help them understand that a page is doing AJAX OR JS Timer . So to download the HTML, you need something that acts more like a browser, by parsing a DOM and executing JS. I recommend http://simile.mit.edu/wiki/Crowbar, which uses a Mozilla engine.
精彩评论