in reply to Re: Download FIle with WWW::Mechanize::PhantomJS
in thread Download FIle with WWW::Mechanize::PhantomJS

'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.

Replies are listed 'Best First'.
Re^3: Download FIle with WWW::Mechanize::PhantomJS
by Anonymous Monk on Dec 24, 2015 at 21:34 UTC

    phantomjs but examples are given in .js

    Great, where is that?

      var fs = require('fs'); var page=this; var result = page.evaluate(function() { var out; $.ajax({ 'async' : false, 'url' : 'fullurltodownload.csv', 'success' : function(data, status, xhr) { out = data; } }); return out; }); fs.write('mydownloadedfile.csv', result);
      Found something here http://stackoverflow.com/questions/31564215/how-to-download-a-csv-file-using-phantomjs.