On Jul 24, 1:22 pm, [EMAIL PROTECTED] (Bdy) wrote: > My code is as follows: > > use strict; use HTML::Stripper; use LWP::Simple qw( get ); my > $stripper = HTML::Stripper->new( skip_cdata => 1, strip_ws => 0 ); > my > $page_html = get(http://www.google.com/about.html); open(FILE, "> > http___www.google.com.html"); print FILE $stripper->strip_html > ($page_html); close(FILE); > > Unfortunately, I'm not sure how I would run the stripper without LWP. > What I would like to accomplish is running a file through > HTML::Stripper apart from LWP. > > Here's what I've produced so far: > > use strict; > use HTML::Stripper; > > my $stripper = HTML::Stripper->new( > skip_cdata => 1, strip_ws => 0 > ); > > my $page_html = 'H:\test-r-get\google.html'; > open(FILE, "> google.txt"); print FILE $stripper->strip_html > ($page_html); close(FILE); > > Unfortunately, this produces a blank text file. > > Thanks.
It appears that strip_html is expecting you to pass it a scalar containing the html source. Instead, you are passing it a scalar which only contains the name of the file. I suspect that you need to read the file contents and store that in $page_html. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/