Giter Club home page Giter Club logo

amazon-deals-scraper's Introduction

What?

This script is to scrape Amazon Deals page. Read the following instructions to see how to use it.

How to use it?

  1. Download NodeJS first from the following link: https://nodejs.org/en/download/ for your operating system. (e.g, choose Mac if you are using Mac)

  2. Make sure that you have the latest Google Chrome installed. At the time this script was developed, the latest version of Google Chrome was 61. So use something newer or equal to 61.

  3. Download by clicking the button shown below:

    Download

  4. Unzip the downloaded file.

  5. Change your directory to wherever you unzipped it using your terminal.

  6. Run npm install in your current directory. This will download the necessary dependency packages that you need to be able to execute the next step.

  7. Create a new headless chrome instance. Check "Creating a headless chrome instance" section below.

  8. Run node main.js command on your terminal while you are in the same directory.

  9. Once the script is done executing, you will see a new file created named result.js, and just open it using a text editor. You will see a result in JSON format. Use it however you like.

You can use various tools to parse JSON format and consume it within them however you like. It is a very versatile format and can be presented in various shapes and forms using existing tools. For instance, a primitive tool that just formats JSON text into a more readable format is http://jsonviewer.stack.hu/

A Mac User?

If you are using Mac, then you can use the following command in place of the steps # 7 and 8, which will simplify the proces little bit for you:

sudo npm start

This command will trigger tasks in package.json file and run a headless chrome instance and execute node main.js command for you.

Please note that you need to close the headless chrome instance after you got your results.

Notes

After you install NodeJS, please restart your terminal if it is open.

Creating a Headless Chrome Instance

If you are running into "connection refused" problem, then you need to have a running instance of Google Chrome with the following settings:

Windows

Right click the Chrome shortcut, and select properties In the "target" field, append --remote-debugging-port=9222 Or in a command prompt, execute [Your Chrome Installation Dir]/chrome.exe --remote-debugging-port=9222

OS X

In a terminal, execute /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --disabled-gpu=true

Linux

In a terminal, launch google-chrome --remote-debugging-port=9222

amazon-deals-scraper's People

Contributors

tarikguney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.