2

So there is a button call next (page). Its href link is site/blah/#. So i know its really running javascript code. After i finish parsing the first page i would like to parse the next page. How do i simulate a mouse click there so i can continue loading and parsing pages?

i am using C# .NET

Adam Lassek
  • 35,156
  • 14
  • 91
  • 107

2 Answers2

5

childElement.RaiseEvent("OnClick");

4

If you know the id of the tag you can use below given code

WebBrowser1.Document.GetElementById("submit").InvokeMember("click")

if you dont know the id you can follow this code

foreach (System.Windows.Forms.HtmlElement html in WebBrowser1.Document.GetElementsByTagName("a")) {
    if (html.InnerText == "YOUR TEXT") {
         html.InvokeMember("click");
    }
}

Contact if you have any doubt

Zlatan
  • 698
  • 7
  • 16