Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Cache-Control:private,max-age=31536000
- Connection:Keep-Alive
- Content-Disposition:attachment; filename="report.csv"
- Content-Encoding:gzip
- Content-Language:de-DE
- Content-Type:text/csv; charset=UTF-8
- Date:Wed, 22 Jul 2015 12:44:30 GMT
- Expires:Thu, 21 Jul 2016 12:44:30 GMT
- Keep-Alive:timeout=15, max=75
- Pragma:cache
- Server:Apache
- Transfer-Encoding:chunked
- Vary:Accept-Encoding
- clientRequests.phantomPage.onResourceReceived = function(response) {
- console.log('Response (#' + response.id + ', stage "' + response.stage + '"): ' + JSON.stringify(response));
- };
- "contentType": "text/csv; charset=UTF-8",
- "headers": {
- "name": "Date",
- "value": "Wed, 22 Jul 2015 12:57:41 GMT"
- },
- "name": "Content-Disposition",
- "value": "attachment; filename="report.csv"",
- "status":200,"statusText":"OK"
- 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);
- var casper = require('casper').create();
- casper.start("http://captaincoffee.com.au/dump/", function() {
- this.echo(this.getTitle())
- });
- casper.then(function(){
- var url = 'http://captaincoffee.com.au/dump/csv.csv';
- require('utils').dump(this.base64encode(url, 'get'));
- });
- casper.run();
Add Comment
Please, Sign In to add comment