Reading table from browser

4 views
Skip to first unread message

Bal

unread,
Jun 17, 2009, 1:06:36 PM6/17/09
to greasemonkey-users
Hi,

I have a requirement wherein I need to extract data from a table into
a .xls file from browser. If anyone has any related script/pointer
please let me know.

Thanks and Regards,
Bal

qufighter

unread,
Jun 29, 2009, 6:03:10 PM6/29/09
to greasemonkey-users
If you use IE it copies and pastes quite nicely with formatting and
everything (in either direction)

If you want to automate it send the innerHTML to the server with
GM_xmlhttpRequest, parse the table text using Xpath or just explode
and trim the rows and columns, then implode them into a CSV format
which would work in excel.

its alternatively possible to do it all in a userscript and have the
raw CSV data pop up in a new window that you can file save as file.csv

Neat idea for a script that would turn any table into a CSV format...
I would almost develop it if we are sure it doesn't exist....

Why i suggested IE copy paste was if you want colors and pretty stuff
like that would be a lot more complex to support in GM alone. CSV is
just plain text
Reply all
Reply to author
Forward
0 new messages