Hi Everyone,
Could you please help me to login to the page I use this script below, the script only works before opening the site and added credentials but can not click see below error
$ie = New-Object -ComObject 'internetExplorer.Application'
$ie.Visible= $true # Make it visible
$username="username"
$password="password"
$ie.Navigate("https://domain.com/login")
While ($ie.Busy -eq $true) {Start-Sleep -Seconds 10;}
$usernamefield = $ie.document.getElementByID('lemail')
$usernamefield.value = "$username"
$passwordfield = $ie.document.getElementByID('password')
$passwordfield.value = "$password"
$Link = $ie.document.getElementByID('login')
$Link=$ie.Document.getElementsByTagName("button") | where-object {$_.type -eq "Log In"}
$Link.click()
error
You cannot call a method on a null-valued expression.
At line:20 char:1
+ $Link.click()
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
see below Inspect Button Log in

thank you very much for your help,
