NeerajPandey has asked for the wisdom of the Perl Monks concerning the following question:

I am using WWW::Mechanize::PhantomJS to automate a file download. A zip file is downloaded after clicking on some link on website.

$mech->click( {xpath=>'//*[@src="../WRQualtricsControlPanel/CPGraphics/ExportCSV.135 +4750.gif"]',synchronize => 0}, {xpath=>'//*[@onclick="Qualtrics.DownloadData.exportData(event, \'CSV\ +')"]'} );

manually clicking on the link on browser starts file download. How can I get this file downloaded and stored in some location with script?

Replies are listed 'Best First'.
Re: Download FIle with WWW::Mechanize::PhantomJS
by Anonymous Monk on Dec 24, 2015 at 12:43 UTC
    Does the content method work? What does phantomjs.org say about how it handles file downloads?
      'content' is providing source of the page. i used as print $mech->content(); And about handling download I read some articles that show its possible with phantomjs but examples are given in .js. The documentation of WWW::Mechanize::PhantomJS does not state any particular method of handling file downloads.

        phantomjs but examples are given in .js

        Great, where is that?