![]() |
This is a long shot, but wth: Any Perl gurus here familiar with HTML::TokeParser use?
Already dropped my question on a few Perl forums, and I've been detached from my regular Perl master for a few days. If you know your shit and have a moment I'd like to run a question passed you. :helpme
|
post the question here
|
what i'm trying to achieve is that i'd like to extract all the html contained within a specified table. i have targeted the table, and i attempted to clip out the required html using "get_trimmed_text" but it parses the html as text, so all the html tags are not saved using this method. is there an equivelant to using get_trimmed_text I could use within HTML::TokeParser or should I be looking into a different module. IS there a funtion for trimming down html in WWW::Mechanize?
Code:
!/usr/bin/perl |
Shit I just found out there is an HTML::TableExtract module :D, gonna go Google now, peace...
|
peace fucker
|
hrmmm, if i could trim all points before and after a set point in a text file somehow i could make this work. any ideas?
|
Don't know why you're using Tokeparser for this...
Code:
$lchtml = lc($html); |
why not use php. its prob about 3 lines one to grab the content and a regex
|
Quote:
|
Quote:
Code:
$html =~ /(<table.+?<\/table>)/si; |
Quote:
I got some help and have achieved my goal using HTML::TreeBuilder though. Everything has been running just skippy. I'm gonna look mor einto what you've given me though, looks as though it'd shave a few lines off my code... |
Cheers Tempest, shaved 7 lines of code off, and is much easier to remember then the TreeBuilder method for future use.
|
If you're going to do quite a bit of Perl, I'd recomend you get and read this book http://oreilly.com/catalog/9780596520106/ and then the rest in the series... You might also want to check out this downloadable book http://www.perl.org/books/beginning-perl/ or perhaps this site http://www.perltutorial.org/
|
Quote:
|
All times are GMT -7. The time now is 04:01 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123