Is there a way to take the value of a string and pass that to a textbox within a web page while using the webbrowser control?
3 Answers
HtmlDocument doc = this.webBrowser1.Document;
doc.GetElementById("myId").SetAttribute("Value", "someValue");
try this
3 Comments
NateShoffner
Thanks. Another tiny related question. How would I press a button within a webpage as well?
Arsen Mkrtchyan
invoke click like this..webBrowser1.Document.GetElementById("myBtn").InvokeMember("click");
NateShoffner
Whoops, meant to update this. I got it shortly after I asked. Thanks for all your help.
You can do the browser automation in C# for WebBrowser control.
Here's the reference article explaining how you can do that.