Pregunta

So I'm new to powershell. I've built a few scripts for fun but got stuck on one that I don't seem to be able to figure out. I'm trying to automate the clicking of the "Continue" button but don't know what to do. I have tried everything I can think of. Any ideas?

$username='username' 
$password='password'

$ie = New-Object -ComObject 'internetExplorer.Application'
$ie.Visible= $true
$ie.Navigate("https://www.ksl.com/public/member/signin?login_forward=%2F")

while ($ie.Busy -eq $true){Start-Sleep -seconds 1;}   

$usernamefield = $ie.Document.getElementByID('memberemail')
$usernamefield.value = $username

$passwordfield = $ie.Document.getElementByID('memberpassword')
$passwordfield.value = $password

$Link=$ie.Document.getElementsByTagName("input") | where-object {$_.type -eq "continue"}
$Link.click()
¿Fue útil?

Solución

The problem is that the object's Type is Image, not continue. The ClassName is continue. Try this line in that code and see if that works for you:

$Link=$ie.Document.getElementsByTagName("input") | where-object {$_.className -eq "continue"}

Otros consejos

Try

$ie.Document.getElementByID('dado_form_3').submit()
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top