Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/anonymous961/scrapebooks

Just a repo to check puppeteer
https://github.com/anonymous961/scrapebooks

neondb prisma puppeteer typescript

Last synced: 11 days ago
JSON representation

Just a repo to check puppeteer

Awesome Lists containing this project

README

        

# Scrape Book

This is just a repo to scrape books from https://books.toscrape.com/ using puppeteer.

## local development setup

```
npm i //to install dependencies
```

to run the server

```
npm run dev
```

## Endpoint

| Method | URL | Description |
| ------ | --------- | -------------------------------- |
| `GET` | `/books` | Retrieve all books stored in DB. |
| `POST` | `/scrape` | To scrape all the books. |

## Using pages

| Endpoint | Description |
| --------------- | ------------------------------------------------------ |
| `/books` | Initial request. Return first 50 books. |
| `/books?page=2` | Second page, returning 50 books using an offset of 50. |
| `/bokos?page=3` | Third page, returning 50 books using an offset of 100. |