Author Posts

February 14, 2018 at 5:21 pm

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

February 15, 2018 at 12:48 am

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'

February 15, 2018 at 8:40 am

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

February 16, 2018 at 9:08 pm

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

February 19, 2018 at 9:08 am

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