An e-commerce scraper for fetching and sorting Lenovo laptop data.
- About
- Prerequisites
- Quick Two-liner Start
- Installation
- Running Tests
- Starting the Server
- Fetching Sorted Lenovo Laptops
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.
- Node.js installed on your machine
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'
- Clone the repository or download the source code
- Navigate to the project directory
- Install the required dependencies by running:
npm install
To run the unit tests, execute the following command:
npm run tests:unit
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
.
You can fetch Lenovo laptops sorted by price (including storage pricing variations) using either Puppeteer or Playwright.
curl --location --request GET 'http://localhost:5000/api/puppeteer'
curl --location --request GET 'http://localhost:5000/api/playwright'
The response will contain a list of Lenovo laptops sorted by price.