Hi All,
Please help
how to convert html text to plain text.
Thanks
Hi All,
Please help
how to convert html text to plain text.
Thanks
Hi Vishal,
There are quite a few conversion cmdlets but the variation in the structure of HTML doesn’t allow this to be converted so eaily.
CommandType Name ----------- ---- Function ConvertFrom-SddlString Cmdlet ConvertFrom-Csv Cmdlet ConvertFrom-Json Cmdlet ConvertFrom-SecureString Cmdlet ConvertFrom-String Cmdlet ConvertFrom-StringData Cmdlet Convert-Path Cmdlet Convert-String Cmdlet ConvertTo-Csv Cmdlet ConvertTo-Html Cmdlet ConvertTo-Json Cmdlet ConvertTo-SecureString Cmdlet ConvertTo-TpmOwnerAuth Cmdlet ConvertTo-Xml
You can scrape the HTML from web sites and then parse it for what you need.
$web = Invoke-WebRequest -Uri 'http://www.powershell.org' # Have a look at what comes back then pick out what you want. $web.Content
To extract content for powershell.org you could focus on anchor tags which begin with ‘a’
$text = ($web.ParsedHtml.getElementsByTagName('a') | Where{$_.className -eq 'bbp-forum-title'}).innerText $text DSC (Desired State Configuration) PowerShell Q&A Web Site Feedback & Assistance PowerShell Summit Jobs and Industry PowerShell Help Authoring DSC Script resource erroring out on function name from module Get current logged on user (console or RDP) while running under alt credentials Win32_Printer delete method HTML to Text Pester Question Expand property using hash table and PSObject is it possible to use send-mailmessage to send calendar items? Get-WMIObject Win32_LogicalDisk returns disk size of 0 sporadically Pin items to Task bar for Default Profile How do you use DSC to [declaratively] change the drive letter of the CDROM?
One last pointer, the protocol for using tags is to use the topics on which your question is based on rather than adding our PowerShell heroes names.
Michael