Question:
I use successfully a script for web automation from this site: heise web automation
I know it is in german, but perhaps someone can help.
The important part of the e-plus website:
1 2 3 4 5 6 7 8 9 10 11 |
Benutzername: | ![]() Passwort: | ![]() |
the part of the Powershell script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$script:ie = New-Object -comobject InternetExplorer.Application $ie.visible = $false $ie.silent = $true # $ie.Navigate("https://www.eplus.de/login/login.asp") LadenWarten(1) # $ie.Document.getElementById("IDToken1OL").value = $user $ie.Document.getElementById("IDToken2OL").value = $passwort $ie.Document.getElementsByTagName("a") | foreach { if ($_.href -eq "javascript:SSO_Submit()") { $_.Click() } } |
the getElementById worked for ie8 but now I have updated to ie9 and it is not working anymore.
the errormessage:
1 2 3 4 |
+ $ie.Document.getElementById <<<< ("IDToken1OL").value = $user + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : MethodCountCouldNotFindBest |
the count of the arguments is wrong.
all I was able to find was a hint, that in ie9 getElementById changed.
can anybody help?
Thanks, David
Answer:
When automating only one concrete site (and the script is not generic or any site) you can try to set compatibility view in IE settings (Tools -> Compatibility View settings). IE should switch to IE8 view when browsing the site.