FWIW, I already have a command line tool that can do that installed in regular Unix: https://github.com/ericchiang/pup The docs even use the same example of scraping HN.
How does Invoke-WebRequest decide if it’s looking at HTML or something else?
How does Invoke-WebRequest decide if it’s looking at HTML or something else?
Or decide yourself for Invoke-WebRequest to pipe it with whatever the data: ConvertFrom-{JSON,XML,CSV}
With Invoke-WebRequest you get back headers, raw response, etc - and you get to decide whats next. With the RestMethod - just the content as an object.