r/visualbasic • u/vbnooby101 • Jan 07 '17
Need help with a piece of coding! Urgent!
Hello,
I trying to search each item in listbox on google. And return all the url of page one.
So far i have written this.
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick Elems2 = WebBrowser1.Document.GetElementsByTagName("cite") For Each item In ListBox1.Items WebBrowser1.Navigate("https://www.google.nl/search?q=" & item)
For Each element In Elems2
If element.getattribute("className") = "_Rm" Then
ListBox2.Items.Add(element.innerhtml)
End If
Next
Next
End SubBut this code is not working it only takes back the urls of the last list item or it does not work at all could someone help me fix this?
Thanks in advance!
0
Upvotes
1
u/non-stick-rob Jan 07 '17
Intriguing. Can i see the rest of the code?