我正在尝试使用powershell填充输入字段,但是面临这些问题。
$ie = New-Object -com internetexplorer.application;
$ie.visible = $true;
$ie.navigate("https://mxtoolbox.com/blacklists.aspx");
while ($ie.Busy -eq $true) { Start-Sleep -Seconds 1; }
($ie.document.getElementsByName("ctl00$ContentPlaceHolder1$ucToolhandler$txtToolInput") |select -first 1).value ="99.99.99.999";
$ie.Document.getElementsByName("ctl00$ContentPlaceHolder1$ucToolhandler$btnAction").click()
while ($ie.Busy -eq $true) { Start-Sleep -Seconds 1; }
输出:
在此对象上找不到属性“值”。验证 属性存在并且可以设置。在第5行char:1 +($ ie.document.getElementsByName(“ ctl00 $ ContentPlaceHolder1 $ ucToolhand ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:InvalidOperation:(:) [],RuntimeException + FullyQualifiedErrorId:PropertyNotFound方法调用失败,因为[System .__ ComObject]不包含名为 “点击”。在线:6字符:1 + $ ie.Document.getElementsByName(“ ctl00 $ ContentPlaceHolder1 $ ucToolhandl ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:InvalidOperation :(单击:字符串)[],RuntimeException + FullyQualifiedErrorId:MethodNotFound