By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,852 Members | 1,426 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,852 IT Pros & Developers. It's quick & easy.

HTML table parser to get the required content and store in an array

P: 3
Hi,

I am trying to write a program to fetch the HTML table values and store in the array as they are in the table.

<table>
<tr><td>value1</td><td>value2</td><td>value3</td></tr>
<tr><td>value1</td><td>value2</td><td>value3</td></tr>
......
.......
</table>

assume there are other tables also there.
I have tried WWW:mechanize, HTML:parser. but as i am new to these parsing, i don't know how to write and fetch. If you can help me to get the value then it will be more helpful.

Thank you in advance for helping

I tried to search in cpan, and other sources but dint get
Jan 24 '08 #1
Share this Question
Share on Google+
6 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
Please DO NOT turn on your signature for your posts. Personal URL's and emails are not allowed in the regular forums per the Posting Guidelines. Please read them and adhere to them.

Regards,

MODERATOR
Jan 24 '08 #2

numberwhun
Expert Mod 2.5K+
P: 3,503
Hi,

I am trying to write a program to fetch the HTML table values and store in the array as they are in the table.

<table>
<tr><td>value1</td><td>value2</td><td>value3</td></tr>
<tr><td>value1</td><td>value2</td><td>value3</td></tr>
......
.......
</table>

assume there are other tables also there.
I have tried WWW:mechanize, HTML:parser. but as i am new to these parsing, i don't know how to write and fetch. If you can help me to get the value then it will be more helpful.

Thank you in advance for helping

I tried to search in cpan, and other sources but dint get
You say you have tried those two modules, but have you read their documentation on CPAN? The documentation usually gives pretty good examples of how to use the modules.

Regards,

Jeff
Jan 24 '08 #3

P: 3
Actually i have already gone through the CPAN documents...
But i dint get the example related to my issue.

Assume in a web page we have more than 3 table and all tables have the same layout and structure. I wants to compare with some text inside some TD of TR. And then wants to take that particular table for further process.

I mean, fetch the TD value in the 2 dimensional array.
Jan 26 '08 #4

KevinADC
Expert 2.5K+
P: 4,059
There is HTML::TableParser but I have never used it myself. The documentation is not easy to understand. But maybe you can try experimenting with code and get it to work.
Jan 26 '08 #5

P: 25
Hi all. Could someone PM me the link to that parser tutorial. I have been looking for the same thing. Trying to make a parser that would grab the data , put it in an array then store it in mysql. Some fun bit of coding :)
Apr 30 '08 #6

KevinADC
Expert 2.5K+
P: 4,059
Hi all. Could someone PM me the link to that parser tutorial. I have been looking for the same thing. Trying to make a parser that would grab the data , put it in an array then store it in mysql. Some fun bit of coding :)

Start here: http://search.cpan.org/
Apr 30 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.