惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
宝玉的分享
宝玉的分享
Latest news
Latest news
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
美团技术团队
V
Visual Studio Blog
F
Full Disclosure
腾讯CDC
H
Help Net Security
D
DataBreaches.Net
M
MIT News - Artificial intelligence
罗磊的独立博客
博客园 - 司徒正美
N
Netflix TechBlog - Medium
U
Unit 42
Vercel News
Vercel News
I
InfoQ
S
SegmentFault 最新的问题
B
Blog RSS Feed
博客园 - 三生石上(FineUI控件)
Microsoft Security Blog
Microsoft Security Blog
有赞技术团队
有赞技术团队
博客园_首页
The GitHub Blog
The GitHub Blog
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
NISL@THU
NISL@THU
P
Privacy & Cybersecurity Law Blog
Recorded Future
Recorded Future
Y
Y Combinator Blog
S
Schneier on Security
P
Proofpoint News Feed
T
Tenable Blog
Cloudbric
Cloudbric
博客园 - 【当耐特】
The Register - Security
The Register - Security
人人都是产品经理
人人都是产品经理
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security
量子位
A
Arctic Wolf
N
News and Events Feed by Topic
H
Hacker News: Front Page
MongoDB | Blog
MongoDB | Blog
The Hacker News
The Hacker News
Webroot Blog
Webroot Blog

博客园 - pot

在框架中(IFRAME/FRAMESET)传递COOKIE的解决方案[转] jQuery图片播放插件Fancybox使用方法 C#生成缩略图代码 数据抓取的一个类,包含一些常用的方法 C#编号的ActiveX控件采用CAB的布署方式实例 C#编写ActiveX控件实例(包括命令和事件) PdfAcroViewer C#代码登录活动目录 用XML反序列化快速完成ASP.NET配置文件 - pot - 博客园 android Activity类的使用 Android中的Intent详细讲解 Android模拟器常用使用,和基本功能使用 ZPL II 命令参考 正则表达式语法 - pot - 博客园 《C#异常处理》 C#中接口的作用 The RSA key container could not be opened - pot ASP.NET 页面事件执行顺序 关于object sender,EventArgs e 的一些解释
抓取AJAX网页的方法-Firefox组件,C#集成
pot · 2011-09-25 · via 博客园 - pot

现在AJAX的使用越来越广泛了,但是如果经常写网页抓取程序的人会发现,很多网页内容是通用AJAX进行加载的,实际抓取到的内容寥寥无几。

通过网络到处查找方法,发现用firefox浏览器能够正常把AJAX内容通过HTML呈现出来,那么是否意味着我们获取AJAX网页有希望了?

功夫不负有心人,进一步研究发现,firefox确实有一款C#组件,可以用C#集成到桌面程序中。

1)需要引用一个叫Skybound.Gecko.dll的文件。

2)此外还需要导入一个firefox支持的文件夹,代码如下:

Xpcom.Initialize(@"C:\xulrunner-1.9.1.14.en-US.win32.sdk\xulrunner-sdk\bin");

xulrunner-1.9.1.14.en-US.win32.sdk这个文件夹比较大,压缩后都有二十多M,无法上传,可以去google一下,但是记得一定要搜这个名字,因为我试过其它的有些不能用。

3)直接指定URL就可以访问网站了,可以通过this.geckoWebBrowser1.Navigate(URL);来指定。还有很多功能,自己去发现吧。