Skip to content

Instantly share code, notes, and snippets.

@sente
Created December 9, 2015 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sente/eacff86d72449e074cb8 to your computer and use it in GitHub Desktop.
Save sente/eacff86d72449e074cb8 to your computer and use it in GitHub Desktop.
Add an Amazon item to a specific wishlish
function expand_wishlist(){
document.getElementById('add-to-wishlist-button').click()
}
function add_to_wishlist(){
var aTags = document.getElementsByTagName("span");
var searchText = '{"type":"wishlist","id":"1FC8KCH8KCN1T"}'
var found;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].getAttribute('data-atwl-dd')== searchText) {
found = aTags[i];
break;
}
}
if (found){
found.click()
}
}
setTimeout(expand_wishlist,500);
setTimeout(add_to_wishlist,2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment