Last active
November 19, 2020 16:42
-
-
Save dreki/4bcd3a5bae8d2bab0239a80333363a67 to your computer and use it in GitHub Desktop.
Log Amazon Wish List contents (as of Nov 2020)
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
let output = ''; | |
for (const el of wishList.querySelectorAll('[id^="itemName"]')) { | |
const itemName = el.innerText; | |
let amazonLink = el.getAttribute('href'); | |
if (amazonLink) { amazonLink = ` (🔗 https://amazon.com${amazonLink})`; } | |
if (!amazonLink) { amazonLink = ''; } | |
output = output + `- ${itemName}${amazonLink}\n`; | |
const comment = el.closest('.a-column').nextSibling.querySelector('[id^="itemComment"]'); | |
if (comment && comment.innerText.trim() !== "") { | |
output = output + ` 💬 ${comment.innerText}\n`; | |
} | |
} | |
console.log(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run this on your Amazon Wish List page, in the developer tools in Chrome.