Question Fill a Field on the browser and submit it

Billie1123

Member
Joined
Oct 24, 2009
Messages
11
Programming Experience
Beginner
Well... Id like my program to write automaticaly into some page's fields.

Lets put google.es as example. Google's field is called "q" (at least the spanish version).

I have tried some code.

WebBrowser1.Navigate (google.es)
WebBrowser.Document.Forms(0).q.Value = "field text".

This is something that I found over there, but it doesn't work at all...

Any idea?
 
See this thread http://www.vbdotnetforums.com/net-sockets/9644-webbrowser-help-need-newbie-button-click.html

It takes time to load a webpage. The Navigate call doesn't wait for the page to be loaded, it returns immediately and notifies progress with events. So only when the the browser says it has completed loading you can interact with the document.

A better approach for this would be to pass the form parameters in the querystring like this:
google.es/search?q=search+string
 
See this thread http://www.vbdotnetforums.com/net-sockets/9644-webbrowser-help-need-newbie-button-click.html

It takes time to load a webpage. The Navigate call doesn't wait for the page to be loaded, it returns immediately and notifies progress with events. So only when the the browser says it has completed loading you can interact with the document.

A better approach for this would be to pass the form parameters in the querystring like this:

Ok, thanks.
It worked!

I didn't know that it didn't wait for the browser to get loaded. It will also be usefull in another process of the aplication.

Now I just have to addapt the code to another web.

Google was just an example, and that's why I couldn't use a modified
querystring

Thanks a lot.
 
Back
Top