Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8032839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:31:00+00:00 2026-06-05T01:31:00+00:00

How do I download a file with WWW::Mechanize without exiting on failed downloads? #!/usr/bin/perl

  • 0

How do I download a file with WWW::Mechanize without exiting on failed downloads?

#!/usr/bin/perl

use strict;
use WWW::Mechanize;

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

$mech->get("http://google.com/test", ':content_file' => "tmp");

print "done";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:31:02+00:00Added an answer on June 5, 2026 at 1:31 am

    You can use autocheck => 0 in the constructor :

    #!/usr/bin/perl
    
    use strict;
    use WWW::Mechanize;
    
    my $mech = WWW::Mechanize->new(
        # perldoc WWW::Mechanize | less +/autocheck
        autocheck => 0
    );
    
    $mech->get("http://google.com/test", ':content_file' => "tmp");
    
    # Now, need to check errors manually :
    # test on the HTTP return code see :
    # http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
    my $retcode = $mech->status();
    if ($retcode >= 400) {
        warn("error getting url, HTTP code: [$retcode]\n");
    }
    
    print "done\n";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the code: #!/usr/bin/perl use strict; use WWW::Mechanize; my $url = 'http://divxsubtitles.net/page_subtitleinformation.php?ID=111292'; my
I want to download images using WWW:Mechanize and to save into the file names
I'm trying to download the XLS file from this page: http://www.nordpoolspot.com/Market-data1/Elspot/Area-Prices/ALL1/Hourly/ (click on Export
I want to download a .zip file which is available at URL http://www.nseindia.com/content/equities/cmbhav.htm by
i download a kml file : <?xml version=1.0 encoding=UTF-8?> <kml xmlns=http://www.opengis.net/kml/2.2> <Document> <Style id=transGreenPoly>
I'm trying to download http://www.downway1.com/dota/eng/DotA%20Allstars%20v6.67.w3x this file. But it's not able to download. It's
I am trying to download a file from a site using perl. I chose
When I trying to download some HTML file with the code below: $mech->get($link) $mech->save_content(file.html);
I'm running Perl on Windows XP, and I need to download a file from
wget http://www.example.com/file.doc downloads that file to the local disk. What is the equivalent of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.