Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^19: Need help with WWW::Mechanize and Chrome cookies

by bakiperl (Beadle)
on Jul 19, 2021 at 14:09 UTC ( #11135166=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @links = $mech->find_all_links(url_regex => qr/\.pdf/i);
    my @urls = map { $_->url_abs } @links;
    ...
       $mech->set_download_directory( $abs_path );    
       $mech->get($foo);
    }
    
  2. or download this
    my $filename = "C:/path/filename";
    my $foo = "http link";
    $mech->get($foo, ':content_file'=>$filename);
    
  3. or download this
    my $response = $mech->get($url);
    my $c = $mech->content; # Dummy request to initialize everything
    open my $output, '>:raw', '/tmp/output.jpg';
    print { $output } $response->decoded_content;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11135166]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (1)
As of 2023-06-04 11:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (21 votes). Check out past polls.

    Notices?