Created
October 10, 2015 18:39
-
-
Save ivansabik/05d7107c4026eec024cb to your computer and use it in GitHub Desktop.
Scrape soundcloud playlist with casperjs and slimerjs then save to text file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var casper = require('casper').create(); | |
var fs = require('fs'); | |
casper.start('https://soundcloud.com/vlad-gonta/sets/new-1', function() { | |
this.viewport(768, 10000); | |
}).then(function () { | |
this.scrollToBottom(); | |
this.wait(1000); | |
}).then(function () { | |
this.scrollToBottom(); | |
this.wait(500); | |
}).then(function () { | |
this.scrollToBottom(); | |
this.wait(500); | |
}).then(function () { | |
this.scrollToBottom(); | |
this.wait(500); | |
}).then(function () { | |
this.scrollToBottom(); | |
console.log('Writing to file'); | |
fs.write('/tmp/soundcloud.html', this.getHTML()); | |
this.capture('/tmp/soundcloud.png'); | |
}) | |
casper.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment