GithubHelp home page GithubHelp logo

node-imagecapture-server's Introduction

#node-imagecapture-server Fire up a server that will take a screenshot of your website. Uses Chrome headless, via puppeteer.

Getting started

$ npm install
$ node server.js

Options

Parameter Description
url The target URL for the screenshot
ww (optional) The width of the window. (default: 1024)
wh (optional) The height of the window. (defaults to height of content)
wait (optional - true,false) Wait for the target webpage to trigger window.triggerScreenshot();
timeout (optional - integer) Timeout in ms (defaults to 30000)

PhantomJs

Some older sites use the PhantomJs branch rather than the main Puppeteer branch. Note that these branches are slightly incompatible. Switching a site using one branch to the other requires slightly different JavaScript when using the wait param to have the site trigger taking a screenshot. Switching without making the required code changes will result in timeout errors.

The PhantomJs branch can be set up as a Windows service (using NSSM to run node.exe server.js for example), or as an IIS site. To set it up as an IIS site, create a new site in IIS as normal, go to Default Document, and add server.js.

You can test that the site is set up correctly by browsing to <yourPhantomJsIisSite>?url=<someTestSiteLikeGoogle>. If you receive an error about spawning phantomJs, make sure that the phantomPath configured in server.js is the correct location for phantomJs.exe. You can also run "phantomjs testing.js" to check for console errors.

node-imagecapture-server's People

Contributors

chris-eng-velir avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.