Webb Simpson

Extracting HTML Table with Powershell

That is the most screwed up set of tables!

There are 5 tables in that page. Some of them actually work (i.e., there’s a header for each column). The rest of them either use a non-breaking space for the 1st column header (which sometimes seems to throw the script into situation where it throws an exception), or puts the column header in one table and then the data in the following table (e.g., tableindex 2 and 3).

Without trying to debug author’s script, this is the best I could come up with:

$w = Read-HtmlTable.ps1 -InputObject c:/junk/powerenergy_mhtml.htm -tableindex 0 # -Header ‘Instantaneous’,’Pos Average’,’Neg Average’ $x = Read-HtmlTable.ps1 -InputObject c:/junk/powerenergy_mhtml.htm -tableindex 1 # skip tableindex2 — it casses an exception $y = Read-HtmlTable.ps1 -InputObject c:/junk/powerenergy_mhtml.htm -tableindex 3 -Header ‘1’,’2′,’3′,’4′ $z = Read-HtmlTable.ps1 -InputObject c:/junk/powerenergy_mhtml.htm -tableindex 4 -Header ‘1’,’2′,’3′

Source

pgagameday
Welcome to GameDay.Blog Powered by SportsBook-Live.com. Please register to our site, As more States become Available for Online Gambling, We will automatically upgrade your status from Subscriber to Player. Please note we are not affilliated in any way with ESPN, CBS Sports, Home depot or CitiBank GameDay Programs. https://gameday.blog
http://pga.gameday.blog