Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi friends, i use a webbrowser control in vb.net to navigate to a webpage that displays an html table with data. the goal is to extract all data to an external file and i've pretty much succeeded it, but because the table consists of multiple pages i can't automate the navigation to the next (or previous) page. the next page link on the browser is like a button and its link runs jscript (i think). the outer html line of the button is:
HTML
<td class=" dr-dscr-button rich-datascr-button" onclick="Event.fire(this, 'rich:datascroller:onscroll', {'page': 'next'});"></td>


What I have tried:

so far i have managed to identify the html element (button) to click:

Dim oLink As HtmlElement = Nothing
For Each oLink In WebBrowser1.Document.All
Try
If oLink.OuterHtml.ToString.Trim.Contains("{'page': 'next'}") Then
Exit For
End If
Catch ex As Exception

End Try
Next

solution one to click:

oLink.Focus()
SendKeys.Send("{ENTER}")

solution two:

oLink.InvokeMember("click")

none of them work. i have no idea how to call jscript if it is needed. can you help?
Posted
Comments
Maciej Los 22-Feb-16 16:47pm    
Not much information to help you, esecially when you need to switch between files.
Member 12333388 22-Feb-16 21:11pm    
it's the same table. it is displayed in pages of ten results per page.
Maciej Los 23-Feb-16 9:26am    
You should be more specific and provide more details... Note, we don't see your screen and we can't read in your mind. How we can know all these details which you know?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900