Created
December 9, 2015 12:09
-
-
Save sente/eacff86d72449e074cb8 to your computer and use it in GitHub Desktop.
Add an Amazon item to a specific wishlish
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
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