All Projects → ebidel → Try Puppeteer

ebidel / Try Puppeteer

Licence: apache-2.0
Run Puppeteer code in the cloud

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Try Puppeteer

Headless Chrome Crawler
Distributed crawler powered by Headless Chrome
Stars: ✭ 5,129 (+698.91%)
Mutual labels:  puppeteer, headless-chrome
thal
译文:Puppeteer 与 Chrome Headless —— 从入门到爬虫
Stars: ✭ 651 (+1.4%)
Mutual labels:  headless-chrome, puppeteer
puppeteer-email
Email automation driven by headless chrome.
Stars: ✭ 135 (-78.97%)
Mutual labels:  headless-chrome, puppeteer
Puppeteer Lambda Starter Kit
Starter Kit for running Headless-Chrome by Puppeteer on AWS Lambda.
Stars: ✭ 563 (-12.31%)
Mutual labels:  puppeteer, headless-chrome
Pyppeteer
Headless chrome/chromium automation library (unofficial port of puppeteer)
Stars: ✭ 3,480 (+442.06%)
Mutual labels:  puppeteer, headless-chrome
Rendertron
A Headless Chrome rendering solution
Stars: ✭ 5,593 (+771.18%)
Mutual labels:  puppeteer, headless-chrome
puppeteer-github
GitHub automation driven by headless chrome.
Stars: ✭ 15 (-97.66%)
Mutual labels:  headless-chrome, puppeteer
throughout
🎪 End-to-end testing made simple (using Jest and Puppeteer)
Stars: ✭ 16 (-97.51%)
Mutual labels:  headless-chrome, puppeteer
Mochify.js
☕️ TDD with Browserify, Mocha, Headless Chrome and WebDriver
Stars: ✭ 338 (-47.35%)
Mutual labels:  puppeteer, headless-chrome
Apify Js
Apify SDK — The scalable web scraping and crawling library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.
Stars: ✭ 3,154 (+391.28%)
Mutual labels:  puppeteer, headless-chrome
phantom-lord
Handy API for Headless Chromium
Stars: ✭ 24 (-96.26%)
Mutual labels:  headless-chrome, puppeteer
Md To Pdf
Hackable CLI tool for converting Markdown files to PDF using Node.js and headless Chrome.
Stars: ✭ 374 (-41.74%)
Mutual labels:  puppeteer, headless-chrome
nest-puppeteer
Puppeteer (Headless Chrome) provider for Nest.js
Stars: ✭ 68 (-89.41%)
Mutual labels:  headless-chrome, puppeteer
Pptraas.com
Puppeteer as a service
Stars: ✭ 433 (-32.55%)
Mutual labels:  puppeteer, headless-chrome
puppeteer-instagram
Instagram automation driven by headless chrome.
Stars: ✭ 87 (-86.45%)
Mutual labels:  headless-chrome, puppeteer
purescript-toppokki
A binding to puppeteer to drive headless Chrome.
Stars: ✭ 48 (-92.52%)
Mutual labels:  headless-chrome, puppeteer
after-work.js
[DEPRECATED] CLI for automated tests in web projects.
Stars: ✭ 56 (-91.28%)
Mutual labels:  headless-chrome, puppeteer
puppeteer-autoscroll-down
Handle infinite scroll on websites by puppeteer
Stars: ✭ 40 (-93.77%)
Mutual labels:  headless-chrome, puppeteer
hc-pdf-server
Convert HTML to PDF Server by headless chrome with TypeScript. The new version of hcep-pdf-server.
Stars: ✭ 24 (-96.26%)
Mutual labels:  headless-chrome, puppeteer
Webster
a reliable high-level web crawling & scraping framework for Node.js.
Stars: ✭ 364 (-43.3%)
Mutual labels:  puppeteer, headless-chrome

Try Puppeteer!

Run Puppeteer scripts in the cloud.

Try it: https://try-puppeteer.appspot.com

Develop

Installation:

yarn; yarn install-backend
# or npm i

Backend

The backend is a Docker container which installs the latest Chrome package that works with Puppeteer on Linux.

Note: You'll need to have Docker running before attempting each step in this section.

Building it

yarn build

Running the container

The container can be run in two modes: standalone as an executable, or as a web service.

1. Using the standalone CLI

The first is a "standalone" mode that runs a Puppeteer script from the CLI. It takes a script file as an argument and runs it in the container.

./backend/run_puppeteer.sh your-puppeteer-script.js

2. Running the web service

The second option is running the container as a web server. The endpoint accepts file uploads for running your Puppeteer scripts in the cloud:

Start the server:

cd backend
yarn serve
# yarn restart is handy too. It rebuilds the container and starts the server.

Example - running a Puppeteer script

async function runCode(code) {
  const form = new FormData();
  form.append('file', new Blob([code], {type: 'text/javascript'}));
  const resp = await fetch('http://localhost:8080/run', {method: 'POST', body: form});
  return await resp.json();
}

const code = `
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  console.log(await page.content());
  browser.close();
`;

runCode(code).then(result => {
  if (result.errors) {
    console.error(result.errors);
  }
  console.log(result.log);
});

Notes:

  • There's no need to require('puppeteer'). This is done for you on the backend.
  • Top-level async/await are supported.

Code editor frontend

Fire up the code editor UI from the main directory:

yarn serve

Then navigate to http://localhost:8081.

Deployment

  1. Update the version of Puppeteer used in index.html, include the doc link. TODO: make this automatic.

  2. yarn deploy deploys both the frontend and backend services to App Engine Flex. The apps can also be deployed individually:

yarn deploy-frontend
yarn deploy-backend

Notes & Limitations

  • By default, Puppeteer launches and uses its own bundled version of Chromium. To use the google-chrome-unstable installed by the container, pass executablePath:

    const browser = await puppeteer.launch({
      executablePath: 'google-chrome-unstable'
    });
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].