需要有关网络浏览器的帮助 [英] Need help with aweb browser

查看:68
本文介绍了需要有关网络浏览器的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨-我正在为自己的项目工作,我想在其中打开网页并将所需的数据或Web数据提取到CSV/excel文件中?我已经完成了webbrowser的工作,但是dnt knw如何开始获取目标数据?有帮助吗?请问???使用c#和.net

Hi - i am working on a project for my own where i want to open a webpage and extract the required data or web data to a CSV/excel file? i m done with webbrowser but dnt knw how to get started wth getting targeted data? any help?? plss??? working in c# and .net

推荐答案

在这里使用Web浏览器几乎无济于事.您需要直接使用HTTP.您只需要使用类System.Net.HttpWebRequest发送HTTP请求,获取HTTP响应(System.Net.HttpWebResponse)并分析结果,对其进行解析,等等.请参见:
http://msdn.microsoft.com/en-us/library/system.net. httpwebrequest.aspx [ ^ ](在此处找到代码示例),
http://msdn.microsoft.com/en-us/library/system.net. httpwebresponse.aspx [ ^ ].

基本上,您将需要使用 Web抓取技术的一些元素:
http://en.wikipedia.org/wiki/Web_scraping [如何从另一个站点获取数据 [ ^ ],
从网页中获取特定数据 [
Using a Web browser here will hardly help you much. You need to work with HTTP directly. All you need is to use the class System.Net.HttpWebRequest to send HTTP request, get HTTP response (System.Net.HttpWebResponse) and analyze the result, parse it, etc. Please see:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^] (find a code sample here),
http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.aspx[^].

Basically, you will need to use some elements of Web scraping techniques:
http://en.wikipedia.org/wiki/Web_scraping[^].

For some more detail, please see my past answers:
How to get the data from another site[^],
get specific data from web page[^].

—SA


这篇关于需要有关网络浏览器的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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