How to Convert HTML table to CSV file with same structure with powershell
问题 With Powershell, I can get the table with this - $URL = "http://example.com/yyy.htm" $OutputFile = "$env:temp\tempfile.xml" # reading website data: $data = Invoke-WebRequest -Uri $URL # get the first table found on the website and write it to disk: @($data.ParsedHtml.getElementsByTagName("table"))[0].OuterHTML | Set-Content -Path $OutputFile Now I want this table to be converted to CSV... How do I do that? Table example - Datacenter | FirstDNS | SecondDNS | ThirdDNS | FourthDNS --------------