UPDATE
Actually, I just saw information that there is now ie.ElementWithTag, look at this question.
So maybe the rest of this post will not be so helpful.
You do not have a ready-made solution, but perhaps a starting point.
For some (long) time I wrote a script automation for one page. I used powershell, but it is easy to port it to C # (which I assume you are using).
So, in this part of the script, I'm looking for a page element that has a tag input and is called Save Changes.
#getting property from com object::IHTMLDOMAttribute function getProperty ([System.__ComObject] $obj, [string] $prop) { [System.__ComObject].InvokeMember($prop, [System.Reflection.BindingFlags]::GetProperty, $null, $obj, $null) } $ie = new-object -com "InternetExplorer.Application"; $ie.visible = $true; $ie.navigate("http://mytestpage.com"); $doc = $ie.Document; $saveButton = $null; $inputElts = $null; $inputElts = $doc.getElementsByTagName('input') foreach ($elt in $inputElts) { $a = $elt.getAttributeNode('value') if ($a -and (getProperty $a 'nodeValue') -eq 'Save changes') { $saveButton = $elt; break; } }
So, if you replace the part in loop that is looking for the element’s Save Changes property (and remove the getProperty declaration) with the correct class, than this should do the trick.
source share