Powershell,即ie9和getElementById
|
我已成功使用此站点上的Web自动化脚本:heise Web Automation
我知道它是德语,但也许有人可以提供帮助。
e-plus网站的重要部分:
<tr>
<td class=\"td1\">Benutzername:</td>
<td class=\"space\"><img src=\"/img/c.gif\" alt=\"\" /></td>
<td class=\"td2\"><input type=\"text\" id=\"IDToken1OL\" name=\"IDToken1\" onfocus=\"setToken(this)\" onblur=\"getToken(this)\" value=\"Benutzername\" /></td>
</tr>
<tr>
<td class=\"td1\">Passwort:</td>
<td class=\"space\"><img src=\"/img/c.gif\" alt=\"\" /></td>
<td class=\"td2\"><input type=\"password\" id=\"IDToken2OL\" name=\"IDToken2\" onfocus=\"setToken(this)\" onblur=\"getToken(this)\" value=\"\" class=\"passwortFake\" /></td>
</tr>
Powershell脚本的一部分:
$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()
}
}
getElementById适用于ie8,但现在我已更新为ie9,并且不再起作用。
错误消息:
+ $ie.Document.getElementById <<<< (\"IDToken1OL\").value = $user
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
参数的计数是错误的。
我所能找到的只是一个提示,即ie9中的getElementById已更改。
有人可以帮忙吗?
谢谢大卫
没有找到相关结果
已邀请:
3 个回复
凄嘛姥
破弯
对于getElementsByTagName:
\“
呸溉