Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extracting table along with HTML tags

Status
Not open for further replies.

kaancho12

Technical User
Feb 22, 2005
191
hi,
is it possible to use HTML::TableExtract along with some other functions to extract the table and its contents and display the result in html format.
I am letting people search something on our site (but in the background using search on another site) and grabbing the results which is returned in one of the tables. i want only a couple of the columns in the returned tables to show and I use HTML::TableExtract to extract it. But i am losing the html tags in it.
thanks
ko12
 
Why not write a simple loop to read the html and copy to a scalar from where you see a <table> tag to where you see a </table> tag?
Roll your own?

Trojan.
 
If you post a (reduced) sample of the html source and a simple example of the result you need I'll write some code that will do it for you.


Trojan.
 

i think i figured it out. I am receiving the data in a certain pattern so i worked it out.
thanks
ko12
 
It sorta depends how you are reading your data,

If you are using a filehandle, then start reading/buffering from <table till you find a </table>

If i'ts in a var, then you could use a single regex in a while loop to ectract all the tables in your html.

[ponder]KrK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top