'Exception from HRESULT: 0X800A01B6' error in PowerShell when trying to enter login information to Facebook

前端 未结 3 1696
花落未央
花落未央 2020-12-16 06:07

I have this code written in PowerShell:

$username = \"xxxxxx\";
$password = \"xxxxxx\";
$url = \"www.facebook.com/login\";

$ie = New-Object -com internetexp         


        
3条回答
  •  -上瘾入骨i
    2020-12-16 06:54

    use this:

    $Url = "http://websiteurl"
    $ie = New-Object -com internetexplorer.application;
    $ie.visible = $true; # make to $true to see the result in webpage
    $ie.navigate($Url);
    while ($ie.Busy -eq $true) { Start-Sleep -Seconds 10; }
    ($ie.Document.IHTMLDocument3_getElementsByName("btnname") | select -first 1).click();
    $ie.quit()
    
    

提交回复
热议问题