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

0

1 Answer 1

0

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

PowerHTML

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.