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
    Posts
    • #228958
      Participant
      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
      Participant
      Topics: 17
      Replies: 1872
      Points: 3,640
      Helping Hand
      Rank: Community Hero

      ccgll0152, welcome to Powershell.org. 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.

      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()

      • This reply was modified 6 months, 2 weeks ago by Rob Simmers.
Viewing 1 reply thread
  • The topic ‘How to click on a website download button using Powershell-ElementID changes’ is closed to new replies.