Problem with automating Logon to a web site

Welcome Forums General PowerShell Q&A Problem with automating Logon to a web site

This topic contains 0 replies, has 1 voice, and was last updated by  Nick Rimmer 2 weeks, 5 days ago.

  • Author
    Posts
  • #180708

    Participant
    Topics: 11
    Replies: 13
    Points: 129
    Rank: Participant

    Hi,

    I'm trying to automate logging onto a web site and I can get the username and password entered with the following code:

    $ie=New-Object -Comobject 'InternetExplorer.Application

    $usernamefield = $ie.document.IHTMLDocument3_getElementByID('username')

    $usernamefield.value = $username  ........

    Where I am having an issue is with sending a click to the Login button.If I use by element or ID, it returns a null, I'm thinking it's not finding the button? 

    The html is in the following screenshot.

    https://github.com/Nick-Rimmer2016/Snippets/blob/master/2019-10-01%2016_12_39-Window.png

     

    Thanks

    Nick

     

You must be logged in to reply to this topic.