本文介绍了使用HTML敏捷搜索所需数据后,如何从网页中抓取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从获取信息



放入使用HTML Agility Pack的ASPX页面。但是我不能那样做,因为在我搜索网页中的数据之后数据被加载了。



我需要在5分钟的时间间隔后连续完成一些数据。

解决方案 div>

您提到的网站中的搜索结果是使用Javascript动态呈现的,数据是通过Ajax作为Json响应的。 HtmlAgilityPack旨在解析Html,而不是Json。



考虑使用 Selenium iMacros .Net驱动程序,或者 WebBrowser 类提供了Microsoft Framework。这些工具在后台运行浏览器,所以他们可以在该页面中运行Javascript代码并呈现Html,以便进行刮擦。

只需设置适当的超时时间,他们会一直等待,直到搜索结果出现在页面上。


I want to get information from this website

into my ASPX page using the HTML Agility Pack. But I cannot do that, since the data is loaded after I search the data in the webpage.

I need some data to be done continuously after an interval of 5 mins.

解决方案

Results for searches in the website you've mentioned are rendered dynamically using Javascript and the data comes as Json response via Ajax. HtmlAgilityPack is intended to parse Html, not Json.

Consider using Selenium or iMacros drivers for .Net, or WebBrowser class provided Microsoft Framework. These tools run a browser in background, so they can run Javascript code in that page and render Html you want to scrape.

Just need to set up proper time out, so they will keep waiting until search results appear onto the page.

这篇关于使用HTML敏捷搜索所需数据后,如何从网页中抓取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 18:05