Giter Club home page Giter Club logo

dokku-puppeteer-example's Introduction

dokku-puppeteer-example

An example app with Node.js, Express.js, Puppeteer and Chrome Headless.

Puppeteer is a Node library which provides a high-level API to control headless Chrome over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome.

By using Puppeteer and Express.js you can easily create endpoints to do all sorts of things like scrape web sites(and execute Javascript). Dokku makes deploying these services a breeze, so it's a good fit.

Chrome headless requires additional packages to be installed so it will not work with a default Dokku installation. Fear not, as it is quite simple to fix by using the excellent dokku-apt plugin. Simply follow the instructions below and you'll be scraping sites in minutes!

Installation

The installation instructions assume Dokku version >=0.7

  1. (On your development machine). Clone the project: git clone https://github.com/mskog/dokku-puppeteer-example

  2. (On your server) Install Dokku http://dokku.viewdocs.io/dokku/getting-started/installation/#1-install-dokku

  3. (On your server) Puppeteer/Chrome needs additional packages to be installed in the Docker containers in order to get Chrome running. To do this you need the dokku-apt plugin for Dokku. Follow the instructions at https://github.com/F4-Group/dokku-apt

  4. (On your server). Create your application: dokku apps:create <YOUR_APP_NAME>

  5. (On your development machine). Add dokku to your git remotes: git remote add dokku dokku@<YOURSERVER>:<YOUR_APP_NAME>

  6. (On your development machine). git push dokku master

Dokku will now build the containers and launch your application. This will take a while. By the end it will give you the URL to your app. Visit that url and it should give you the Puppeteer search results for "puppeteer"

dokku-puppeteer-example's People

Contributors

mskog avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.