如何解析包含javascript的渲染网页 [英] How to parse a rendered web page containing javascript

查看:97
本文介绍了如何解析包含javascript的渲染网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从渲染的网页中提取数据? 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属性获取浏览器控件的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的渲染网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆