Skip to content

Instantly share code, notes, and snippets.

@dreki
Last active November 19, 2020 16:42
Show Gist options
  • Save dreki/4bcd3a5bae8d2bab0239a80333363a67 to your computer and use it in GitHub Desktop.
Save dreki/4bcd3a5bae8d2bab0239a80333363a67 to your computer and use it in GitHub Desktop.
Log Amazon Wish List contents (as of Nov 2020)
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);
@dreki
Copy link
Author

dreki commented Nov 14, 2020

Run this on your Amazon Wish List page, in the developer tools in Chrome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment