我正在尝试从网络时钟中自动生成时间报告,由于某种原因,该报告具有电子邮件警报,但无法通过电子邮件发送时间卡片(smh)。
这是我正在查看的内容:
<form method="post" action="" name="formMain">
<div><label for="username">Username/PIN</label> <input id="username" type="text" name="username" value="" autocapitalize="off" autocorrect="off" /> </div>
<div><label for="password">Password</label> <input id="password" type="password" name="password" value="" onKeyPress="capsLockOn(event);" /> </div>
<div><label for="ClockTime"> </label><div id="ClockTime">Not Available</div></div>
<div class="buttons"><label for="submit"> </label> <input class="colorSettings" type="submit" value="Submit" onClick="document.getElementById('buttonClicked').value='Submit';" /></div>
<input id="buttonClicked" type="hidden" name="buttonClicked" value="none"/>
</form>
使用以下代码,我至少能够预填充用户名和密码字段:
$Url = “http://URL”
$Username=”user”
$Password=”pass”
$IE = New-Object -com internetexplorer.application;
$IE.visible = $true;
$IE.navigate($url);
while ($IE.Busy -eq $true)
{Start-Sleep -Milliseconds 2000;}
$IE.Document.getElementById(“username”).value = $Username
$IE.Document.getElementByID(“password”).value=$Password
$IE.Document.getElementById(“buttonClicked”).Click()
但是我无法单击“提交”按钮。
任何建设性的建议将不胜感激!
您可以将其用作最后一行并提交表单,而不必尝试单击该按钮。
$IE.Document.getElementById("formMain").submit()
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句