Use webBrowser load https://weibo.com/7570366566/K4kyM3wlX this page directly, after loading the access to the Document, but not all, also not line package weibo content,
Public _click ()
{
InitializeComponent ();
WebBrowser1. Navigate (" https://weibo.com/7570366566/K4kyM3wlX ");
}
Private void button1_Click (object sender, EventArgs e)
{
HtmlElementCollection elements=webBrowser1. Document. GetElementsByTagName (" div ");
HtmlElement TempElement;
Foreach (HtmlElement element in elements)
{
If (element. The GetAttribute (" class ")=="WB_detail")
{
TempElement=element;
}
}
}
Why is that?
CodePudding user response:
Are there not? In 140 lines of the scriptCodePudding user response:
Within the script tag, you are looking for can't find the content div tags is sure