Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/entrptaher/puppeteer-express-api-example
Minimal puppeteer express api example
https://github.com/entrptaher/puppeteer-express-api-example
Last synced: about 6 hours ago
JSON representation
Minimal puppeteer express api example
- Host: GitHub
- URL: https://github.com/entrptaher/puppeteer-express-api-example
- Owner: entrptaher
- Created: 2019-07-18T20:25:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T22:54:03.000Z (almost 2 years ago)
- Last Synced: 2024-05-28T16:18:11.671Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
This is a minimal example of a single threaded scraper api. You can create and control and instance.
Positively, It shows the minimal ways to create scraping api and negetively, the limitations of how storing the references inside one process/file will cause scaling issues.
# Instructions
- Clone the repo
- Install all dependencies
- Start the main api with `node index.js`# API
- `/create` creates an browser instance and gives you an unique id.
- `/title/:id/:url` navigates to a website and grabs the title.
- `/remove/:id` closes a browser instance.# How it works
It creates a instance and stores the unique id to a instances object. Whenever you want to access the browser with specific id, it grabs the references from the object.