webbrowser+Nsoup 实现百度文库内容复制
NSoup.Nodes.Document NSoupDoc = NSoup.NSoupClient.Parse(webBrowser1.Document.Body.InnerHtml);
var strpagecount = NSoupDoc.Body.Select(".page-count").Text;
if (strpagecount.Contains("/"))
{
strpagecount = strpagecount.Replace("/", "");
}
int pagecount = 0;
if (!int.TryParse(strpagecount, out pagecount))
{
MessageBox.Show("页数处理失败");
return;
}
StringBuilder content = new StringBuilder();
for (int i = 0; i < pagecount; i++)
{
content.Append(NSoupDoc.Body.Select("#pageNo-"+(i+1)).Text);
}
1