Can I set values to inputs inside of my WebBrowser control?

browser c# html-agility-pack

Question

I have a web page loaded into a WebBrowser object. What I want to do is access the elements on that page to input data. For example, enter username and password and submit the form.

How is this possible? Any ideas?

Could I use HTMLAgilityPack to access the elements and set their values?

Popular Answer

Check out this documentation example: http://msdn.microsoft.com/en-us/library/system.windows.forms.htmldocument.aspx

Through the web browser control, there is a Document property of type HtmlDocument, which gives you some ability to affect the page. I personally don't know if it can do everything you want, but this would be a good starting point.

HTH.




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why