开发者

How to parse a rendered web page containing javascript

开发者 https://www.devze.com 2022-12-12 13:27 出处:网络
How can one extract data from a rendered web page? In which java script would update the data with time.

How can one extract data from a rendered web page? In which java script would update the data with time. Is it possible to write user script which can access varibles from webpage java script? Please sugg开发者_运维问答est possible way to achieve this.


according to Turing's Halting Problem Theorem, you can't.

That's what we mean when we say that JavaScript is a Turing complete language. The only way is to execute the JavaScript and let it render the page.


it depends on your programming language.

In C# you could use a webbrowser control, then use the Webbrowser.Document property to get a HTMLDocument object to get the current markup. To invoke javascript function in the document, use the ObjectForScripting property of the Browser control.

0

精彩评论

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

关注公众号