问题描述
如何从渲染的网页中提取数据?Java脚本会随着时间更新数据.是否可以编写可以从网页Java脚本访问变量的用户脚本?请提出实现此目标的可能方法.
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 suggest possible way to achieve this.
推荐答案
这取决于您的编程语言.
it depends on your programming language.
在C#中,您可以使用网络浏览器控件,然后使用Webbrowser.Document属性获取 HTMLDocument 对象以获取当前标记.要在文档中调用javascript函数,请使用浏览器控件的ObjectForScripting 属性.
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.
这篇关于如何解析包含javascript的渲染网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!