Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > passing html table to cgi

Reply
Thread Tools

passing html table to cgi

 
 
Matthew
Guest
Posts: n/a
 
      01-19-2004
I've been trying to find a way to gather up data contained in a table
or tables on a previously generated html page in order to send it to a
cgi for further processing. Ideally this would scrape the page for
the tables' data (or even just those tables with more than 2 rows and
2 columns) in a way that could be sent to the cgi using a form.
Thanks for any help or pointers in the right direction.
 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      01-19-2004
Matthew said:
>
>I've been trying to find a way to gather up data contained in a table
>or tables on a previously generated html page in order to send it to a
>cgi for further processing. Ideally this would scrape the page for
>the tables' data (or even just those tables with more than 2 rows and
>2 columns) in a way that could be sent to the cgi using a form.
>Thanks for any help or pointers in the right direction.


How are you planning to use this? To extract data from pages that
you visit on other sites, or from your own pages? In either case,
it would probably be easier to do it on the server than in a web
browser.

 
Reply With Quote
 
 
 
 
Matthew
Guest
Posts: n/a
 
      01-20-2004
This would only be for my own pages. I've used an activex construct
(included below) that scrapes tables out of the html and puts the data
into an Excel spreadsheet. This works well if the end user has the
right operating system/browser combination.

In another context, I've used Perl with the Spreadsheet::WriteExcel
and Spreadsheet:arseExcel modules to generate Excel spreadsheets.
So, I am hoping to be able to send the html tables to a Perl cgi where
I can parse and write the data out to an Excel spreadsheet similiar to
the activex method, but without the activex lack of portability.

Here's the activex example (found this example somewhere, sorry I
can't currently find where to correctly attribute):

<A href=
"javascriptfunction(){Ts=document.getElementsByT agName('table');
if(!Ts)alert('No%20tables.');else{try{X=new%20Acti veXObject('Excel.Application');X.visible=true;for( i=0;T=Ts[i];++i){Rs=T.rows;if(Rs.length>1&amp;&amp;Rs[0].cells.length>2){X.workBooks.add();for(r=0;R=Rs[r];++r){for(c=0;C=R.cells[c];++c){D=X.cells(r+1,c+1);
if(r==0){D.entireColumn.columnWidth=12;D.entireCol umn.verticalAlignment=-4160;}D.value=C.innerText.replace(/\r/g,'');}}}}}catch(e){alert('Couldn\'t%20open%20Exce l.');}}})();
">Download table to Excel</A><BR>

thanks again for any help!

Lee <> wrote in message news:<>...
> Matthew said:
> >
> >I've been trying to find a way to gather up data contained in a table
> >or tables on a previously generated html page in order to send it to a
> >cgi for further processing. Ideally this would scrape the page for
> >the tables' data (or even just those tables with more than 2 rows and
> >2 columns) in a way that could be sent to the cgi using a form.
> >Thanks for any help or pointers in the right direction.

>
> How are you planning to use this? To extract data from pages that
> you visit on other sites, or from your own pages? In either case,
> it would probably be easier to do it on the server than in a web
> browser.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pass value from one html to another html through python-cgi Monima Software 0 12-14-2010 10:36 AM
CGI html table generation Justin C Perl Misc 2 03-03-2010 03:31 PM
(Ab)using class CGI as non-CGI HTML generator? Josef 'Jupp' Schugt Ruby 3 03-06-2005 11:34 AM
Table/table rows/table data tag question? Rio HTML 4 11-05-2004 08:11 AM
Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table. David Williams ASP .Net 2 08-12-2003 07:55 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57