Reputation: 2451
I have a webBrowser (System.Windows.Forms.WebBrowser
) in my windows form,
And I have set the url property to "http://www.google.com", And when I run the solution, it shows google in my form.
My question is, can you programmatically write stuff in the search box?
Do I have access to DOM elements within the webBrowser and can I modify them?
Upvotes: 0
Views: 131
Reputation: 3284
You can do so using the Document property of the WebBrowser control, something like this should work (not tested)
if (webBrowser1.Document == null) return;
var input = webBrowser1.Document.GetElementById("gbqfq")
input.SetAttribute("value","search for foobar");
hope this helps!
Upvotes: 2