CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Converting LWP's get $url results to text.

 



ajmcello
Novice

Oct 2, 2010, 12:51 PM

Post #1 of 3 (503 views)
Converting LWP's get $url results to text. Can't Post

 
I was able to do something like:

$content = parse_html( get $url)->format;

which converts the HTML to text. This works great, but when running in a loop, parse_html crashes my machine because it runs out of memory!

Anybody know how I can fix this, or is there a better way to convert HTML to text without using parse_html?

Thanks


7stud
Enthusiast

Oct 7, 2010, 2:00 AM

Post #2 of 3 (483 views)
Re: [ajmcello] Converting LWP's get $url results to text. [In reply to] Can't Post

Disclaimer: This module is provided only for backwards compatibility with earlier versions of this library. New code should not use this module, and should really use the HTML::Parser and HTML::TreeBuilder modules directly, instead.


AnkurMundhada
Novice

Oct 7, 2010, 10:35 PM

Post #3 of 3 (473 views)
Re: [ajmcello] Converting LWP's get $url results to text. [In reply to] Can't Post

you can also use "HTML::TokeParser::Simple"

http://search.cpan.org/~ovid/HTML-TokeParser-Simple-3.15/lib/HTML/TokeParser/Simple.pm
Thanks
Ankur M.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives