Created
November 6, 2015 19:43
-
-
Save maggiben/4dccdf32309506b3296c to your computer and use it in GitHub Desktop.
get list of http://www.porn-star.com/archive.html
This file contains hidden or 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
function download(filename, text) { | |
var pom = document.createElement('a'); | |
pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); | |
pom.setAttribute('download', filename); | |
if (document.createEvent) { | |
var event = document.createEvent('MouseEvents'); | |
event.initEvent('click', true, true); | |
pom.dispatchEvent(event); | |
} | |
else { | |
pom.click(); | |
} | |
} | |
archive = document.querySelectorAll('.archive') | |
var text = ''; | |
Array.prototype.slice.call(archive).forEach(function(list){ | |
var names = list.nextElementSibling.querySelectorAll('li'); | |
Array.prototype.slice.call(names).forEach(function(name) { | |
//console.log(name.textContent) | |
text = text + "['" + name.textContent + "'], "; | |
}) | |
}) | |
download('list.txt', text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment