Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to go to a link and save a page and email it out?

Reply
Thread Tools

How to go to a link and save a page and email it out?

 
 
dalewz@gmail.com
Guest
Posts: n/a
 
      12-15-2004
Thanks for helps here. I tried the simple method - HTML::Mail.

HTML::Mail works for some web sites. But it does not work for some. The
results are:

C:\Perl\scripts>mailp.pl
Error while making request [ GET
http://www.macom.com/Images/darkblue_bgcolor.gi
f]
404 Object Not Found at C:/Perl/lib/HTML/Mail.pm line 167.

C:\Perl\scripts>

-----Mail.pm
164 my $response = $self->{'_ua'}->get($uri);
165
166 if (!$response->is_success) {
167 die "Error while making request [ GET ", $response->request->uri,
"]\n", $response->status_line;
168 }

However, if I use IE to open www.macom.com, I can save the page with
all images. Any suggestions?

Thanks a lot. -Dale
PS> my script is:
use HTML::Mail;

### initialisation
my $html_mail = HTML::Mail->new(
HTML => 'http://www.macom.com',
>From => '(E-Mail Removed)',

To => '(E-Mail Removed), http://www.velocityreviews.com/forums/(E-Mail Removed)',
Subject => 'Alert page');

### Send the email ("inherited" from MIME::Lite)
# $html_mail->send();
$html_mail->send('smtp','outgoing.verizon.net');

#### Remove text representation
$html_mail->set_Text();

### Rebuild the message and send
$html_mail->build->send;

### Serialise to file for later reuse
$html_mail->dump_file('c:/html_mail.data');

### Restore from file
my $restored = HTML::Mail->restore_file('c:/html_mail.data');

 
Reply With Quote
 
 
 
 
Matt Garrish
Guest
Posts: n/a
 
      12-16-2004

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Thanks for helps here. I tried the simple method - HTML::Mail.
>
> HTML::Mail works for some web sites. But it does not work for some. The
> results are:
>
> C:\Perl\scripts>mailp.pl
> Error while making request [ GET
> http://www.macom.com/Images/darkblue_bgcolor.gi
> f]
> 404 Object Not Found at C:/Perl/lib/HTML/Mail.pm line 167.
>


Did you maybe stop and think that the image isn't there? It really doesn't
matter that you can open the page in IE and it looks okay to your eyes, as
that has nothing to do with whether the image exists or not.

The image doesn't exist, by the way, so you either go back to the drawing
board, modify the code not to die if the image is missing, or email the
author and ask him to.

Matt


 
Reply With Quote
 
 
 
 
dale
Guest
Posts: n/a
 
      12-16-2004
Thank you all for the helps. I have found the solution by using
WWW::Mechanize. It is really cool.

-Dale

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
how to automatically "Save " a page after certain intervals without clicking "Save Page As..." subhadip Java 0 03-28-2007 04:15 PM
I want to create a link "e-mail this page to a friend" on clicking this link i want to send the URL of that current page to a friend pavi Javascript 0 01-13-2006 12:10 PM
go to a link, save the page and email it out? dale Perl Misc 10 12-17-2004 05:22 PM
Follow-up:go to a link, save the page and email it out? dale Perl Misc 1 12-16-2004 12:07 PM



Advertisments