1
我使用C#窗口应用程序来获取网页HTML内容,但返回的内容未完成(新闻列表丢失,因为它使用Java脚本加载)。我添加了一个webBrowser控件,并导航到我想要的内容的URL,并在documentDompleted事件我得到documentText缺少一些HTML标签。我尝试了所有的解决方案在stackoverflow,但他们失败了。下面是代码:完全加载后获取页面内容
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void buttonParse_Click(object sender, EventArgs e)
{
string url = textBoxURL.Text.Trim();
this.webBrowser1.Navigate(url);
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
string content = webBrowser1.DocumentText;
}
}
,这是我想获得其内容的网址:
http://search.youm7.com/home/Index?allwords=%D8%B3%D8%AF%20%D8%A7%D9%84%D9%86%D9%87%D8%B6%D9%87
我使用的是Windows窗体应用程序,以获取该页面的HTML内容,我只可以使用WebBrowser控逆变事件。 – Abdelrahman