drawrowfly / amazon-product-api

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

ORA spin loader causes issues on module import + lack of CORS headers #2

Closed pedrsntana closed 4 years ago

pedrsntana commented 4 years ago

First, thanks for this package, literally the only decent amazon scraper on NPM. Now onto the issues:!

  1. The ORA spinner looks really nice on the terminal, but when importing the module, the same spinner breaks everything. 1.1 The ORA package makes use of the readline package: const readline = require('readline'); but this package is not located in ORA package.json. 1.2 Even after installing the readline package, ORA still causes issues in the package. Deleting any mentions of ORA from Amazon Scraper solves the issue.

  2. I'm also encountering some CORS issues.

pedrsntana commented 4 years ago

BTW a simple way to bypass the CORS issue, is to replace "https://www.amazon.com/" in index.js with "https://cors-anywhere.herokuapp.com/https://www.amazon.com/".

Like so: this._mainHost = 'https://cors-anywhere.herokuapp.com/https://www.amazon.com/';

drawrowfly commented 4 years ago

Hi. Thanks )

I will take a look at all the issues within next few days

const readline = require('readline');

readline is a Core module since Node version 4