I know we are supposed to add as many details as possible, but I do not know much about how this works, so my details will be minimum. I am not sure if this is the correct/best way to do this, so please go easy on me. Here is my situation:
I want to get information from a webpage. I can't give you the webpage because it's internal to a company. Basically the webpage has a form with a bunch of text-boxes and a couple buttons (one being submit). I want to programmatically (with PowerShell - or maybe something else like Python if it would work better) web request the page to submit a piece of information and get the results.
I basically have a list of names that I need to loop through. Done manually, each name would be pasted into one of the text-boxes on the page, the submit button would be clicked, and the results would pop up.
I want to loop through the list of names and perform a post webrequest on each item, then grab the results. Can this be done with PowerShell?
I have been messing around with Invoke-WebRequest, but I am not entirely sure how it works. I am pretty sure that the webpage can have post requests performed on it because when I execute
$req = Invoke-WebRequest -URI https://www.foobar.com -Method Post
I do not get any errors about the webpage not accepting posts. Any advice?
Here is some relevant code from the webpage:
<button class="Button k-button k-button-first SearchButton" data-categorytext="#SearchByValue, #ServerRequestValue" data-summary="" id="btnSearch_SearchBy">Search</button>
<script>
jQuery(function(){jQuery("#btnSearch_SearchBy").kendoButton({});});
</script>
The textbox that I need to provide information to
<input class="k-textbox SearchField" data-summary="Server Name like " id="ServerNameSearchValue" name="ServerNameSearchValue" style="width: 300px;" type="search" value="SOME_SERVER_NAME_FROM_MY_LIST" />
When the form is submitted, a window pops up on the page with the results. The page does not reload or anything, so would I need to perform a get request on the page after I perform the post request to get the information from the new window?