DotNetExpose
1.0.0
DotNetExpose 是一个 .Net 库,用于帮助您抓取网页。它向您显示了有关该页面的大量信息。
版本1.0.5:
使用包管理器进行安装。
Install-Package DotNetExpose -Version 1.0.5安装包后:
using Expose . Main ;创建 ExposeHtmlDocument 的实例。构造函数需要一个 URL。该 URL 将被抓取。
const string URL = "https://www.google.com.br/"
ExposeHtmlDocument expose = new ExposeHtmlDocument ( URL ) ;返回 html 页面中引用的 CSS 文件总数
int countCSS = expose . CountCSSAsync ( ) ;返回html页面引用的JS文件总数
int countJS = expose . CountJSAsync ();返回 Html 元素总数
int countHtmlElements = CountHtmlElementsAsync ( ) ;返回 META 元素总数
int countMetaTags = expose . CountMetaAsync ( ) ;返回所有JS内容
HashSet < string > hsJS = expose . GetJSContentAsync ( ) ;返回所有CSS内容
HashSet < String > hsCSS = expose . GetCSSContentAsync ( ) ;返回html中所有元素的onclick事件总数
int countOnclickEvents = expose . CountOnclickEventsAsync ( ) ;返回html页面中Forms的总数
int countForms = expose . CountFormsAsync ( ) ;从表单返回 Action 和 HttpMethod
Dictionary < string , string > dicFormInfo = expose . FormsInfoAsync ( ) ;返回页面的大小(以 Kb 为单位)
long ? pageSize = expose . GetSizeOfPageAsync ( ) ;返回包含找到的信息量的 JSON
string report = expose . GetReportAsync ( ) ;返回真/假
bool hasAjaxCall = expose . HasAjaxCallAsync ( ) ; 欢迎请求请求。对于重大更改,请先打开一个问题来讨论您想要更改的内容。
请确保适当更新测试。
麻省理工学院