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;