Skip to content

Instantly share code, notes, and snippets.

@engleek
Created May 8, 2016 23:03
Show Gist options
  • Save engleek/5aaf046e22c40a379a8ae93ddc7579b1 to your computer and use it in GitHub Desktop.
Save engleek/5aaf046e22c40a379a8ae93ddc7579b1 to your computer and use it in GitHub Desktop.
Save Amazon Basket to CSV
const basket = artoo.scrape('.sc-list-item', {
title: { sel: '.a-size-medium.sc-product-title.a-text-bold' },
link: { sel: '.sc-product-link', attr: 'href' },
image: { sel: '.sc-product-image', attr: 'src' },
price: { sel: '.sc-product-price' },
});
const basket2 = basket.map(({ image, link, price, title }) => ({ image, link, price, title: title.trim() }));
artoo.saveCsv(basket2)
// artoo.writers.csv(basket2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment