问题
So, Invoke-WebRequest
in Powershell Core is permanently baked with -UseBasicParsing
. More details can be found here and here.
Net result - no ParsedHtml
property on the result object.
While the rationale makes perfect sense, the question is - how to parse HTML in Powershell Core?
Now, I can probably use a .NET Core library, like HtmlAgilityPack, but it seems like vast code changes would be required to migrate existing PS code to use this library.
Is this our best option or are there any better ones for PS Core users?
来源:https://stackoverflow.com/questions/56777597/how-to-parse-html-in-powershell-core