Skip to content

BrenoAlberto/EcommerceScrapper

Repository files navigation

E-Commerce Scraper

An e-commerce scraper for fetching and sorting Lenovo laptop data.

Table of Contents

About

This project was created as a part of a job application process. It is a simple Node.js server that uses Puppeteer and Playwright to scrape data from https://webscraper.io/test-sites/e-commerce/allinone/computers/laptops and return a list of Lenovo laptops sorted by price.

Prerequisites

  • Node.js installed on your machine

Quick Two-liner Start

In case you want to quickly test the project, you can run the following commands:

  npm install && npm run build && npm run start
  curl --location --request GET 'http://localhost:5000/api/puppeteer'

Installation

  1. Clone the repository or download the source code
  2. Navigate to the project directory
  3. Install the required dependencies by running:
npm install

Running Tests

To run the unit tests, execute the following command:

npm run tests:unit

Starting the Server

To start the server, first build the project and then run the start script:

npm run build && npm run start

The server will start on http://localhost:5000.

Fetching Sorted Lenovo Laptops

You can fetch Lenovo laptops sorted by price (including storage pricing variations) using either Puppeteer or Playwright.

Using Puppeteer

curl --location --request GET 'http://localhost:5000/api/puppeteer'

Using Playwright

curl --location --request GET 'http://localhost:5000/api/playwright'

The response will contain a list of Lenovo laptops sorted by price.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published