I am writing a web automation that fills out lengthy online forms based on stored data and then notifies the user of the results. The website that I am automating names all of it’s objects, but does not use the id tag. Is there something like HtmlDocument.GetElementById that works with the name tag? I don’t think GetElementsByTagName is right. It doesn’t return the specific element, but instead generates an array.
Share
You can iterate over the elements returned by
GetElementsByTagNameand check theirnameattribute (which is not the same as a tag name).GetElementByTagNamegets all elements that have the same element name (so for images, the tag name isimg).