Skip to content

Instantly share code, notes, and snippets.

@PrateekKumarSingh
Created January 24, 2017 18:11
Show Gist options
  • Save PrateekKumarSingh/f31bacde1dc0f2b1cf5bec0db08d1638 to your computer and use it in GitHub Desktop.
Save PrateekKumarSingh/f31bacde1dc0f2b1cf5bec0db08d1638 to your computer and use it in GitHub Desktop.
$Content = @"
<HTML>
<BODY>
<h1> This is a heading </h1>
<P id='para1'>First Paragraph with some Random text</P>
<P>Second paragraph with more random text</P>
<A href="http://Geekeefy.wordpress.com">Cool Powershell blog</A>
</BODY>
</HTML>
"@ | Out-File File.html
# Create HTML file Object
$HTML = New-Object -Com "HTMLFile"
# Write HTML content according to DOM Level2
$HTML.IHTMLDocument2_write($Content)
$HTML.all.tags("p") | % InnerText
$HTML.getElementById('para1') | % InnerText
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment