Well, I haven't got to the script part but there are some work arounds.
Save the web page and open in dreamweaver
In Dreamweaver, in design view you can go to file , export, table, text and export the table as a tab delimited txt file
Another option is to use navicat (paid, though there is a trial version) the latest beta has a rather good html import.