I got a little problem with my Webbrowser. I want to let it fill out some Webforms by itself. Just the same as an Cookie, but stored in a Database. So how can I send the needet Text to the fields on a Webpage ? I wanna make it possible that my browser do all by itself e.g. fill out username and passwort. I got it work that it fills out normal textboxes and some Comboboxes. But if the Combobox has no Value, it doesnt work. Also I got a problem with the Buttons. If it is an normal button, I can easily click it, but what is the code to click a gif picture if it is the "button" ? Hope anyone can help me coz I´m searching since a long time for a solution for that. For those who didnt understand what I mean:
To fill out a normal Textbox, I use:
Set objinput = webbrowser1.Document.All.tags("input")
objinput(6).Value = "whatever I want"
For a combobox with values:
Set objselect = webbrowser1.Document.All.tags("select")
objselect(0).Value = "an existing value"
For normal buttons:
webbrowser1.Document.Forms(0).Elements(24).Click
(The numbers in the"()" are the numbers of the elements on the Webpage.
Ok, I hope everyone has understod what I mean, and someone can help me with this. Thx for reading this post.
Set objinput = webbrowser1.Document.All.tags("input")
objinput(6).Value = "whatever I want"
You need a blank form and the webbrowser item. Now, if you want to fill out a Website which only have 3 Textboxes on it, use the code above, and just change the "6" into the number of the box you want to fill. If you wanna fill the first one (counting from the top to the end) you have to change it to "1" and so on.
Webbrowser1.Navigate "http://www.mysite.com/form.cgi"
WebBrowser1.Document.Forms(0).boxname.Value = "My Text"
WebBrowser1.Document.Forms(0).proceed.Click
'box name and proceed are names of the input box and the submit button.
Hi. As I wrote in the first post, thats exactly what I wanna know, too. I got this problem with the "picture button" too. Well, I´ve tried your tips, but they dont work But there MUST be a solution for this. If we can click a normal button, it MUST be possible to click a picture button, too. I have postet on some other forums with this prob, and if I can find a solution, I´ll post it here.