Created
May 8, 2016 23:03
-
-
Save engleek/5aaf046e22c40a379a8ae93ddc7579b1 to your computer and use it in GitHub Desktop.
Save Amazon Basket to CSV
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
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