Question Place Text in a webbrowser Textbox

To access the Html elements that the browser parses into the DOM tree you always use the Document property, this is your door in. In this case you must take a step back in the tree from the loaded document back to the Window object to access its Frames, then you select the correct frame by integer index/string and get into its Document tree. Here is a sample path that uses what I just described and display the value of that html element:
VB.NET:
Dim s As String  = Me.WebBrowser1.Document.Window.Frames("Login").Document.All.GetElementsByName("Password")(0).GetAttribute("value")
 
Ok thanks that worked, but now i want to press the "Aanmelden" button :/
Been messing with this for like all day, cant get it to click it.
 
Since that element doesn't have a name or an id, and there is no form element that can be submitted, you have to check up on all the input elements to find the one that fits the description, then you can call the "click" method with InvokeMember.
 
Since that element doesn't have a name or an id, and there is no form element that can be submitted, you have to check up on all the input elements to find the one that fits the description, then you can call the "click" method with InvokeMember.

I found the InvokeMember part on google, but i just cant get it to work :/
Can you help me out lol, i wanne get done with this, caused me enough trouble already.
 
Well, you have the frame document, use the GetElementsByTagName method to get a collection of html elements, loop them to determine a match. You choose by what criteria you would recon you are holding the correct element, you have to look at the source code and see if it is possible to extract an attribute value that is unique to that specific element you seek, if not you must using some kind of indexing like first element with a specific tag name from second row in first table. When you have that element you invoke the click method for it.
 
Back
Top