Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27390

VS 2008 Loop through listbox items

$
0
0
I am making a program to automate entering data into a website im building. I can only enter one line of data at a time. So I want to have a listbox with say 8 items, I want to take listbox item 1 enter it into an html feild with the value datafield, click send, then navigate back to my site "mysite.com", enter listbox item 2 into datafield, click send and loop until all listbox items have been entered.

If I set a textbox, this works to enter a single line a data from textbox 1, but how could I loop it to go go through a bunch of listbox items.


'Paste url from textbox to datafield
WebBrowser1.Document.GetElementById("datafield").SetAttribute("value", textbox1.text)

'click search button
Dim allelements As HtmlElementCollection = WebBrowser1.Document.All

For Each webpageelement As HtmlElement In allelements

If webpageelement.GetAttribute("type") = "submit" Then

webpageelement.InvokeMember("click")

End If




Also is there any good way for when I navigate back to "mysite.com" to wait until the sites loaded to enter the next line of data

Viewing all articles
Browse latest Browse all 27390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>