开发者

simple_html_dom timer?

开发者 https://www.devze.com 2023-02-13 12:25 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号