GithubHelp home page GithubHelp logo

Comments (4)

sindresorhus avatar sindresorhus commented on May 21, 2024

Try using some of the options to delay the capture.

from capture-website.

ollejj avatar ollejj commented on May 21, 2024

I did, but it's like your API reads the page before any user-update no matter what.
(No critisism btw, I like this API)

These are the steps:

  1. My page loads
  2. An async function loads properties from an XML-file
  3. The cameras Pan/Tilt are predefined in this XML
  4. I manually pan to a random angle
  5. I run the code with 'node capture.js'
  6. I get the output.png

from capture-website.

ollejj avatar ollejj commented on May 21, 2024

capture.js
const captureWebsite = require('capture-website');

(() => {
captureWebsite.file('http://localhost:61828/ayeW2Mw6/index.html', 'screenshot.png', {
delay: 10
});
})();

from capture-website.

ollejj avatar ollejj commented on May 21, 2024

Solved it by some quirky method.
For any future readers that are experiencing the same issue:
I had an XML that stored the start-angle of the camera. Changing these angles (pan/tilt) and then screenshotting
will grab the graphics at that specific angle.

My solution:

  • Before screenshotting, send the angle that you want to screenshot to backend.
  • Update the hard-coded angles in the file that you're storing them in to the new ones.
  • Grab the screenshot.

However the weird thing about this (maybe @sindresorhus can answer this) is that this library doesn't read from the XML at all. So I have NO idea why this worked.

from capture-website.

Related Issues (20)

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.