I am trying to pull data from a website. In my example case, I am running a search on Armorgames.com for the search term idle. From there I would like to pull the name of each game and put it into a csv file for use later. My code:
$SearchResult = Invoke-WebRequest 'http://armorgames.com/search?type=games&q=idle'
($SearchResult.ParsedHtml.getElementsByTagName('H5') | Where { $_.pathname -like '/play*'})
Unfortunately, that won't output any results. I can see the property names using:
$SearchResult.ParsedHtml.getElementsByTagName('H5')
Using the tag 'a' I can find games with a pathname containing 'play'.But I am having trouble filtering the results and then outputting the results to a file