in reply to Re: Downloads in firefox using perl WWW::Mechanize::Firefox
in thread Downloads in firefox using perl WWW::Mechanize::Firefox

Hello robby_dobby,

I have already read the manual and have been trying various options to get over the problem. The problem is not opening a new tab. I have no problem in opening a new tab, when i set Firefox's default behavior to handle PDF as 'view in Firefox' or 'View in adobe reader'. The problem arises when i set it to 'Save link' and assign a folder to download files.

What happens in this case is that the runs the loop first time and loads the page and firefox downloads the file, and the programs just pauses there and never proceeds forward. If i add a print "reached"; statement after $mech->get() function, i do not see any output.

I want to understand why this happens

Replies are listed 'Best First'.
Re^3: Downloads in firefox using perl WWW::Mechanize::Firefox
by robby_dobby (Hermit) on Mar 11, 2014 at 12:26 UTC
    Are you running this behind a proxy? Chances are, your firefox got stuck when trying to resolve the url you're downloading, with that proxy and failed to authenticate your credentials. Why not use WWW::Mechanize? I'm pretty sure it has some options for proxy authentication.

      I solved the problem. I realized that the $mech->get() function might be waiting for the page to load. But as i set Firefox to download the file automatically, there was no page being loaded. Thus, i set the function to not wait for response from browser and it worked.

      I thank you for helping me out. As this was my first post i made some error in reporting the problem and the code. Next time i will try to frame the question better.