drawrowfly / amazon-product-api

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

Price is always 0 #65

Closed Bariskau closed 2 years ago

Bariskau commented 2 years ago

I added cookies. But the result has not changed, price information is not coming. Is there a different parameter I need to add?

class ProductService {
    async getProduct(asin) {
        await amazonScraper.asin({
            asin: asin,
            country: 'US',
            cookie: "session-id=147-3348510-9162916; session-id-time=2082787201l; ubid-main=130-4538308-0250231;"
        }).then((res) => {
            res.result.map(item => {
                Product.updateOrCreate(item)
            })
        });
    };
}
SohumW12 commented 2 years ago

The same thing is happening to me. Its not for all products though

Bariskau commented 2 years ago

@sohum124 use my forked version

SohumW12 commented 2 years ago

@Bariskau Does it return a valid price? And what changed?

Bariskau commented 2 years ago

There are frequent changes in html tags on amazon. Which means the scraper won't always work. Must be constantly updated. Unfortunately, this package is not constantly updated. After forking, you need to make your own customizations.

SohumW12 commented 2 years ago

Yeah I also assumed the same thing as when I tried building my own with a recent video, the tag was different

Bariskau commented 2 years ago

@sohum124 In some marketplace the price came with the following css class, '.apexPriceToPay'. But most marketplace have been updated now you need to add this class '.priceToPay' as well.