Skip to content

Instantly share code, notes, and snippets.

@tithonium
Created May 5, 2020 03:52
Show Gist options
  • Save tithonium/5a9eb210cde14a78759f5d4e3e2fc2e8 to your computer and use it in GitHub Desktop.
Save tithonium/5a9eb210cde14a78759f5d4e3e2fc2e8 to your computer and use it in GitHub Desktop.
Download all kindle books
rows = $('div.contentTableListRow_myx')
idx = 0
dorow = function(){
if(idx >= rows.length) {
console.log("Done!!!")
return
}
var row = rows[idx]
idx = idx + 1
if(row.textContent.match(/ Sample /)) {
return dorow()
}
console.log(idx, row.textContent)
$('button.myx-button-text', row)[0].click()
setTimeout(function(){
$('#contentAction_download_myx > div > div > div > div > div > div > span')[0].click()
setTimeout(function(){
$('div.myx-popover.myx-popover-modal.dialog_myx a.myx-button.myx-button-primary')[0].click()
setTimeout(dorow, 2000)
},750)
},500)
}
function advidx(name) {
var i = idx
while(i < rows.length) {
if(rows[i].textContent.match(name)) {
idx = i + 1
return;
}
i = i + 1
}
}
dorow()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment