Created
January 24, 2017 18:11
-
-
Save PrateekKumarSingh/f31bacde1dc0f2b1cf5bec0db08d1638 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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