helo dear corion i will try it out. and then i come back and report all.
btw. allways th0ught that i need mechanize .... duhhh aaarg there are some errors with the mechanize....




use strict; use warnings; use WWW::Mechanize::Firefox; my $mech = new WWW::Mechanize::Firefox(); open my $urls, '<', 'urls.txt' or die $!; while (<$urls>) { chomp; next unless /^http/i; print "$_\n"; $mech->get($_); my $png = $mech->content_as_png; my $name = $_; $name =~ s#^http://##i; $name =~ s#/##g; $name =~ s/\s+\z//; $name =~ s/\A\s+//; $name =~ s/^www\.//; $name .= ".png"; open my $out, ">", $name or die $!; binmode $out; print $out $png; close $out; sleep 5; }



guess it is better now.... minor things left to solve...


linux-wyee:/home/martin/perl # perl test_7.pl http://www.unifr.ch/sfm http://www.zug.phz.ch http://www.schwyz.phz.ch http://www.luzern.phz.ch http://www.schwyz.phz.ch + http://www.phvs.ch + http://www.phtg.ch + http://www.phsg.ch + http://www.phsh.ch + Use of uninitia +lized value $png in print at test_7.pl line 25, <$urls> line 10. + + http://www.phr.ch + http://www.hepfr.ch/ http://www.phbern.ch http://www.ph-solothurn.ch http://www.pfh-gr.ch Got status code 500 at test_7.pl line 14 linux-wyee:/home/martin/perl #

what do you think...

In reply to Re^2: WWW::Mechanize::Firefox - allmost there - only a little regex error left by Perlbeginner1
in thread WWW::Mechanize::Firefox - allmost there - only a little regex error left by Perlbeginner1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.