drawrowfly / amazon-product-api

Amazon Scraper. Scrape products from the amazon search result or reviews from the specific product
631 stars 181 forks source link

Allow to use custom amazon host to handle specific languages products #3

Closed gpenverne closed 4 years ago

gpenverne commented 4 years ago

This PR adds an optional parameter to specifiy a specific amazon domain (my goal was to scrap products in french):

bin/cli.js products -k "drone" -H "www.amazon.fr"
drawrowfly commented 4 years ago

Good stuff, but there will be issue with the output data. For example USD prices are showed with dots 49.99 but other currencies as EUR and etc with commas 49,99

We need to update regex to [^D+0-9.,]

Another example:

If you will set host to co.jp there are different values in Price tag again, with current code, price will be empty, we need to add something like that

let priceSearch = $(div[data-asin=${key}] span[data-a-size="l"])[0] || $(div[data-asin=${key}] span[data-a-size="m"])[0];

drawrowfly commented 4 years ago

I just pushed update with mentioned above fixes. You can remove console.log and we can merge

gpenverne commented 4 years ago

I updated my branch. But which console.log have I to remove ?