我正在尝试编写PowerShell脚本以自动下载备份。我似乎无法单击“ item_backup”链接按钮。
这是html:
<div class="item" data-item-group="files" data-item-search-text="Backup restore Backup">
<a class="itemImageWrapper integrations_icon spriteicon_img icon-backup" id="icon-backup" href="backup/index.html"></a>
<a class="itemTextWrapper link" id="item_backup" href="backup/index.html">Backup</a>
</div>
这是我为脚本所需要的。它会打开并登录,但不会单击备份链接。
$url = "https://www.com:2083";
$username="name";
$password="pass";
$ie = New-Object -com internetexplorer.application;
$ie.visible = $true;
$ie.navigate($url);
while ($ie.Busy -eq $true)
{
Start-Sleep -Milliseconds 5000;
}
$ie.Document.getElementById("user").value = $username;
$ie.Document.getElementById("pass").value=$password;
$ie.Document.getElementById("login_submit").click();
while ($ie.Busy -eq $true)
{
Start-Sleep -Milliseconds 9000;
}
$ie.Document.getElementById("item_backup").click();