Auto input webpage form

0

I've been trying to write a script which will automatically reset a users email from a 3rd party, I'm modifying code I wrote which relates to this however I'm having a confusing issue which after investigating seems to be related to the support of IE.

The code i'm using:

$Email= "myname"
$url = "URL"
$ie = New-Object -com internetexplorer.application
$ie.visible = $true

while($ie.Busy) { Start-Sleep -Milliseconds 1000 }

(($ie.Document.IHTMLDocument3_getElementsByTagName("Input")) |select -first 1).value = $username

I was originally using

$emailF = $ie.document.getElementByID('email')
$EmailF.value = "$Email"

However, this resulted in:

Exception from HRESULT: 0x800A01B6

However investigating this here, the fix is to change to $ie.Document.IHTMLDocument3_getElementsByTagName("Input") however now I'm getting the error

Exception setting "value": "The property 'value' cannot be found on this object. Verify that the property exists and can be set."

Thank you in advance

html
powershell
asked on Stack Overflow Sep 4, 2018 by Matthew • edited Sep 4, 2018 by James C.

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0