Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bambooom/puppeteer-examples
just some snippets about how to use puppeteer
https://github.com/bambooom/puppeteer-examples
puppeteer
Last synced: 28 days ago
JSON representation
just some snippets about how to use puppeteer
- Host: GitHub
- URL: https://github.com/bambooom/puppeteer-examples
- Owner: bambooom
- License: mit
- Created: 2018-07-19T09:00:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-20T02:01:13.000Z (over 6 years ago)
- Last Synced: 2024-11-23T11:28:05.716Z (3 months ago)
- Topics: puppeteer
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# puppeteer-examples
just some snippets about how to use puppeteer## browser websocket endpoint
```bash
$ node browser.js&
[1] 9231 # this is the pid of this nodejs process# chromium websocket endppoint url
ws://127.0.0.1:62813/devtools/browser/32385bc8-47c2-47f6-a3e9-ef1a5fd1edbf
# headless chromium's process pid
Chromium pid is: 9244
```It will start a nodejs daemon process, and also start a headless browser for
others to connect. Now it also logs the browser's websocket endpoint and the
process pid, which can be used to kill after running.Then running `node ws-connect.js ws://127.0.0.1:62813/devtools/browser/32385bc8-47c2-47f6-a3e9-ef1a5fd1edbf` to connect the previous browser.
After everything done, close nodejs process and chromium procee by `kill -QUIT {PID}`
for example:
```bash
$ kill -QUIT 9231
```