#!/usr/bin/perl -w use strict; use LWP::UserAgent; use HTML::TokeParser; print 'Enter site: '; chomp( my $site = <STDIN> ); my $ua = new LWP::UserAgent(); my $request = new HTTP::Request( 'GET' => $site ); my $response = $ua->request( $request ); my $data = $response->content(); my $page = new HTML::TokeParser( \$data ); while( my $token = $page->get_token() ) { my $type = shift @{ $token }; my $text = shift @{ $token }; if( $type eq "T" ) { print $text; } }
In reply to Re: How do I extract text from web site?
by DigitalKitty
in thread how do I extarct text from web site
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |