How do I submit one of many submit buttons on a page?

Welcome Forums General PowerShell Q&A How do I submit one of many submit buttons on a page?

This topic contains 4 replies, has 3 voices, and was last updated by

 
Participant
8 months, 4 weeks ago.

  • Author
    Posts
  • #93636

    Participant
    Points: 0
    Rank: Member

    Hi
    I am very new to powershell, so apologies for what is probably a very basic question.
    I have a web page with many (identical looking) submit buttons representing various items. Any advice / pointers on how I can automate the execution of a particular button based on specific hidden attributes would be gratefully appreciated. I am currently using $ie to automate the actions, so I can see exactly what is happening.

    not sure what happened to the code I posted, so I have put it on gist

    Regards
    Kiers

  • #93658

    Participant
    Points: 208
    Helping Hand
    Rank: Participant

    There is no code in your post.
    Secondly, all elements on a web page have a unique ID, Name, other identifier. That is what you look for to interact with.
    You have to have the source of the page or you just enumerate the form object to get what you are after, in most cases.

    Example

        $R = Invoke-WebRequest https://www.facebook.com -SessionVariable FB
        $Form = $R.Forms[0]
        $Form.Fields
    

    If you are really new, it is vital you take a few online no cost courses to get a baseline.

    Learning Resources

    Learn PowerShell: Microsoft Virtual Academy – Getting Started with Microsoft
    PowerShell.

    'mva.microsoft.com/en-us/training-courses/getting-started-with-microsoft-powershell-8276'

    Microsoft Channe9
    'channel9.msdn.com/Series/GetStartedPowerShell3'
    'channel9.msdn.com/Search?term=powershell#ch9Search&lang-en=en&pubDate=year'

    Youtube
    'youtube.com/results?search_query=beginnign+powershell'

    Windows PowerShell Survival Guide
    'social.technet.microsoft.com/wiki/contents/articles/183.windows-powershell-survival-guide.aspxStart-Process'

    eBooks...
    'blogs.technet.microsoft.com/pstips/2014/05/26/free-powershell-ebooks'
    'idera.com/resourcecentral/whitepapers/powershell-ebook'
    'powershell.org/ebooks'

    And start with lots of examples.
    'powershellgallery.com'
    'gallery.technet.microsoft.com/scriptcenter/site/requests'
    'technet.microsoft.com/en-us/scriptcenter/bb410849.aspx'

  • #93672

    Participant
    Points: 0
    Rank: Member

    Thanks for replying. Not sure what happened to the code, so now on gist.
    I am on with the courses – thanks

  • #93876

    Participant
    Points: 0
    Rank: Member

    Hi,
    looking at the htmml I have posted, I don't see any ID's for me to act on. Therefore, how can I identify the correct submit button to action, based on for example the category_id?

    Regards
    Kiers

  • #94006

    Participant
    Points: 13
    Rank: Member

    If you open the site in google chrome and use the developer tools Ctrl + Shift + I when you click on the button you should see the code behind it, enabling you to determine the buttons ID

The topic ‘How do I submit one of many submit buttons on a page?’ is closed to new replies.