flann
Regular Member
- Jan 19, 2008
- 208
- 34
I have a problem exactly like here:
Load a website, search for "cookies" and hit the search button, next it will click a link (link is clicked to fast so it failed to click the link on the searchresult page)
Here is my code:
The solution is this:
I can drag a timer to my form and set the interval, the new code with timer looks like this:
Love to know how to start the timer.
Code:
http://thebotnet.com/programming/104890-wait-for-2nd-sign-up-page/
Here is my code:
Code:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
WebBrowser1.Document.GetElementById("query").InnerText = "cookies"
WebBrowser1.Document.GetElementById("query_button").InvokeMember("click")
[B][U]I NEED A WAIT/DELAY HERE!!!![/U][/B]
Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
For Each webpageelement As HtmlElement In allelements
If webpageelement.InnerText = "Boards" Then
webpageelement.InvokeMember("click")
End If
Next
End Sub
The solution is this:
Code:
drag a timer component on the form. set its interval to around 1-5 sec.
after u press the submit button in your first function have it enable the timer.
in the timer code have it check to see if the page is completed. you can do that by running a foreach loop thru the elements and see if one of the elements matches ur textbox id.
if the page is completed, disable the timer, and run your code.
I can drag a timer to my form and set the interval, the new code with timer looks like this:
Code:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
WebBrowser1.Document.GetElementById("query").InnerText = "cookies"
WebBrowser1.Document.GetElementById("query_button").InvokeMember("click")
Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
For Each webpageelement As HtmlElement In allelements
If webpageelement.InnerText = "Boards" Then
webpageelement.InvokeMember("click")
End If
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
End Sub
End Class
Love to know how to start the timer.