0
Answer

How to get the contents of the web browser control

Ask a question
e h

e h

15y
2.9k
1

Hello,
i need to get the contents of the Web browser control
& i write the following code:
private HTMLDocument document
{
get { return (HTMLDocument)axWebBrowser1.Document; }
}

private HTMLBody body
{ get { return (HTMLBody)document.body; }
}
private void button1_Click(object sender, EventArgs e)
{
string url = "http://wwww.google.com/test#";
url=url+HttpUtility.UrlEncode(textBox1.Text);
axWebBrowser1.Navigate(url);
// Wait for the document to load
while (body == null)
Application.DoEvents();
String content = body.innerText;
}


but during the run time, i pass a new parmaters to the url
then i navigate to the new url and when i get the content of the web browser again
it will not get the new content but it gets the previous one.
can any one help me in this problem