Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

New-Object -com InternetExplorer.Application

$
0
0

Unable to click link using  windows 8.1 and IE 11.  IE blank screen after a time and script hangs , I have to delete IE using regedit and resign in to get IE11 running again,not able to try and a different system

But my main problem is that I can't click the link

any help would be help full

 

$URL = "https://google.co.uk"

$ie = New-Object -com InternetExplorer.Application

$ie.visible=$true

$ie.navigate($URL) 

while($ie.ReadyState -ne 4) {start-sleep -m 100}

$ie.Document.getElementById("A").click()

$yt = $links | where {$_.innerText -eq 'YouTube'}

$yt.click()

 

error 

You cannot call a method on a null-valued expression.

At C:\Users\ste\Documents\A POWERSHELL\Untitled70.ps1:9 char:1

+ $yt.click()

+ ~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvokeMethodOnNull

 


Viewing all articles
Browse latest Browse all 6937