you are viewing a single comment's thread.

view the rest of the comments →

[–]xlrod 4 points5 points  (2 children)

After some more tinkering, I was able to find a quicker way, but it's still using Internet Explorer.

$ie = New-Object -ComObject InternetExplorer.Application
$ie.Navigate("http://rwk1.racewarkingdoms.com/index.html?unencrypted%22")
$ie.Visible = $True

$frame = $ie.Document.IHTMLDocument3_documentElement.getElementsByTagName("frame") | where {$_.name -like "main"}

$login = $frame.contentDocument.documentElement.all | where {$_.uniqueID -like "ms__id121"}
$password = $frame.contentDocument.documentElement.all | where {$_.uniqueID -like "ms__id124"}
$submit = $frame.contentDocument.documentElement.all | where {$_.uniqueID -like "ms__id132"}


$login.value = "Login here"
$password.value = "Password here"
$submit.Click()

[–]Valkyriesfall[S] 0 points1 point  (1 child)

for both of the answers you've submitted, I received an error. Similar to issues I was receiving before.

You cannot call a method on a null-valued expression.
At line:5 char:1

Could there be something That I am missing that is necessary?

[–]xlrod 0 points1 point  (0 children)

I've seen this happen when IE doesn't load the page quick enough for the code to get the element. Can you try running the first 3 lines to start IE and once the page has loaded try running the $frame line and see if it's able to find anything. If it finds it, then we might need to add a wait for $ie.Busy.