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:
store the results of a Perl-mechanize job

 



dilbert
User

Dec 10, 2011, 10:04 AM

Post #1 of 1 (394 views)
store the results of a Perl-mechanize job Can't Post

hi dear Perl-friends

well; first of all; i run linux opensuse 11.4 i try to run this little programme on a linux box.


Code
 
#!/usr/bin/perl


use WWW::Mechanize::Firefox;
my $mech = WWW::Mechanize::Firefox->new();

open(INPUT, "urls.txt") or die "Can't open file: $!";

while (<INPUT>) {
chomp;
$mech->get($_);
my $png = $mech->content_as_png();
}
close(INPUT);
exit;


well i have a list of URLS: i have more than 1000 URLS - so it might be a problem if i get the results in a unsorted way.

i have a list of 1000 URLs, one on each line, saved in a file. then i want the script above to open the file, read a line, then retrieve the website! Well the URLS are stored something like this:

Filename: urls.txt

Code
    www.google.com 
www.cnn.com
www.msnbc.com
news.bbc.co.uk
www.bing.com
www.yahoo.com



question: how to write the script that the output of the thumbnail-images are stored with certain names - eg with the domain-names. How to do that!? Otherwise - the resuults would be a whole mess. I need to identify the thumbnails - related to the URLS. :Is this possible!?

love to hear from you

Code



      
    

 
 


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

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