in reply to Re: Grabbing data from webpages
in thread Grabbing data from webpages
(the regexp with the square brackets just gets rid of the image text, otherwise you get a certain amount of '[spacer.gif]')#!/usr/bin/perl -w use strict; use Mail::Mailer; my $recipient ="my email address"; my $sender = "trains\@myhost.co.uk"; my $subject = "trains"; my $mailer = Mail::Mailer->new("sendmail"); $mailer->open({From => $sender, To => $recipient, 'Content-Type' => "text/plain", Subject => $subject }) or die "can't open sendmail"; open (LYNX,'lynx -dump http://www.londontransport.co.uk/rt_home.shtml +|'); while (<LYNX>) { s/(\[.*\])//g ; print $mailer $_ if (/Real time news/ .. /References/); } close(LYNX); $mailer->close();
andy.
|
|---|