How to click on a website download button using Powershell-ElementID changes

Welcome Forums General PowerShell Q&A How to click on a website download button using Powershell-ElementID changes

Viewing 1 reply thread
  • Author
    • #228958
      Topics: 1
      Replies: 0
      Points: 12
      Rank: Member

      Hello All,

      This may be a bit of an advanced topic/question but I am trying to figure out how to click on a download button on a website but the issue is the elementID changes based on the file name each time.  I also need to figure out how to do this for more than 1 file and then lastly how to save as to my download folder when that question pops up.  I have made great progress getting to the download button.  I hope to insert 3 images here to show the issue-source code and the webpage with the blue download button, the save as image, and my powershell commands so far to get there.  Thank you for any pointers/ideas/assistance as I am still learning how to do website commands in powershell.Download button infoMore info for saving fileMy code so far

    • #229083
      Topics: 12
      Replies: 1622
      Points: 2,560
      Helping Hand
      Rank: Community Hero

      ccgll0152, welcome to Please take a moment and read the very first post on top of the list of this forum: Read Me Before Posting! You’ll be Glad You Did!.

      When you post code, error messages, sample data or console output format it as code, please.
      In the “Text” view you can use the code tags “PRE“, in the “Visual” view you can use the format template “Preformatted“. You can go back edit your post and fix the formatting – you don’t have to create a new one.
      Thanks in advance.

          (div id='div1')Blah(/div)
          (div id='div2')
              (div id='buttons')
                  (button type="button")Download(/button)

      The best you can do is try to narrow the objects down. For instance, you could GetElementById(‘div2’), then GetElementByTagName(‘button’) and then foreach $_.Click()

Viewing 1 reply thread
  • You must be logged in to reply to this topic.