Hi all,
I am trying to automate the login of a site so I can grab a link. I’m having issues because the “login form” doesn’t use ID’s and is also present 3 in the page. I think the latter shouldn’t matter as the script should just interact with the first and then the page will change. The former though is where I’m having issues.
So I’ve got the below code which seems to select what I want but not interact with the page at all.
$UserID = "1234" $Email = "Powershell@reddit.com" $URL = "http://www.bpsoftware.net/updates/data-update/" $HTML = Invoke-WebRequest -Uri $URL $x = ($HTML.ParsedHtml.getElementsByTagName("input") | Where{$_.classname -eq "input-user"}) ($x | Select-Object -first 1).value = "test" $x | Select-Object -first 1
I also have the below as approaching it from another approach. I get an error about the invoked object has been disconnected from its clients.
$ie=New-Object -comobject InternetExplorer.Application $ie.visible=$true $ie.Navigate("http://www.bpsoftware.net/updates/data-update/") while($ie.busy){Start-Sleep 1} $value = $ie.Document.getElementsByClassName("input-user") | Select-Object -First 1 Write-Host $value $value.value = "testing"
I’m wondering if any of you would be able to point me in the right direction.
Please speak slowly and using little words.
submitted by /u/sup3rlativ3
[link] [comments]
The post Issue logging into site with no form ID appeared first on How to Code .NET.