5

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?

EDIT 1

The answer seems to be found here - Unable to use IHTMLDocument2

mark
  • 59,016
  • 79
  • 296
  • 580

1 Answers1

0

Probably the easiest way is to use powerHTML module which basically provides a wrapper for HTML Agility Pack

PowerHTML

TaTo
  • 46
  • 1
  • 8