473,395 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

passing html table to cgi

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.
Jul 20 '05 #1
2 1963
Lee
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.

Jul 20 '05 #2
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::ParseExcel 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=
"javascript:(function(){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 <RE**************@cox.net> wrote in message news:<bu********@drn.newsguy.com>...
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.

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
2
by: Andy | last post by:
Hi all, Sorry to present you all with another boring problem but I've spent all day trying to get this to work with no success. Below is a function to which I pass the argument &$myCell (which...
3
by: Fredrik/Sweden | last post by:
Hi folks ! got this problem... i have a table 'Accounts' in my database, which contains a bunch of users. From the main menu i choose "edit user" and all users in the db are presented in a table....
3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
2
by: kie | last post by:
hello, when i create elements and want to assign events to them, i have realised that if the function assigned to that element has no parameters, then the parent node values can be attained. ...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
6
by: dharmadam | last post by:
Is it possible to pass a column name or the order of the column name in the DB2 table table function. For example, I want to update the address of a person by passing one of the address column name...
0
by: Neelima Godugu | last post by:
Hi All, I have developed a windows forms user control, which I am going to host in Internet Explorer.. I am familiar with the security settings requirement inorder to do the above. I have...
6
by: jej1216 | last post by:
I am trying to put together a PHP search page in which the user can select none, one, two, or three fields to search, and then the results php will build the SQL with dynamic where caluses to reflect...
5
by: jmartmem | last post by:
Greetings, I have built an Update Record Form in an ASP page. This form contains a number of fields, such as text boxes and menus, to name a few. Upon clicking the 'submit' button, I want the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.