项目地址
Jumony.Core,号称真正的HTML引擎
,事实也是如此,简单好用,提供jQuery风格的 API。支持.Net Core。
使用Nuget搜索Jumony.Core
安装
var jp = new JumonyParser();
//获取网页数据
var htmlSource = jp.LoadDocument("https://itljf.com/h/p/6369.shtml");
//获取网页html
string html1 = htmlSource.InnerHtml();
//获取id为blog-title的元素的文本
string title1 = htmlSource.Find("#blog-title").FirstOrDefault().InnerText();
//获取class为blog-title的元素的文本
string title2 = htmlSource.Find(".blog-title").FirstOrDefault().InnerText();
会使用JQuery的基本都会使用了