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 ( ) ;
歡迎請求請求。對於重大更改,請先開啟一個問題來討論您想要更改的內容。
請確保適當更新測試。
麻省理工學院