juliangruber / capture-screenshot Goto Github PK
View Code? Open in Web Editor NEWCapture screenshots in multiple browsers!
Capture screenshots in multiple browsers!
"phantomjs --ignore-ssl-errors=true --ssl-protocol=sslv3
How to fix that error.
Hello,
When a website can't be found
example screenshot("http://www.dfdsafdsfdscascdasc12xc.com")
The program just hangs.
Is there a property or method that can be set to exit or throw error after certain time has passed trying to get the website.
The current timeout(3000) is only for waiting for site to load then get snapshot.
Thanks
Hello,
i am using this module, how to use it using an additional phantomjs params?
I had a problem when try to download https site's screenshot.
I resolve it using this command: phantomjs --ssl-protocol=any ......
( http://stackoverflow.com/questions/12021578/phantomjs-failing-to-open-https-site )
Please allow for control of pixel ratio for higher quality of screenshots without changing breakpoints. For example a screen shot of 400x600 * 2pr would yield a 800*1200 image but still have mobile breakpoint activated.
Followed the example.
npm install capture-screenshot --save
const capture = require('capture-screenshot');
const fs = require('fs');
capture({url: 'https://twitter.com/'})
.then(imgs => {
fs.writeFileSync('chrome.png', imgs.chrome);
fs.writeFileSync('electron.png', imgs.electron);
fs.writeFileSync('phantomjs.png', imgs.phantomjs);
});
But got error:
(node:9444) UnhandledPromiseRejectionWarning: Error: Command failed: 'C:\Users\PragmaticEd\workspace\_private\TestApp\node_modules\electron\dist\electron.exe' 'C:\Users\PragmaticEd\workspace\_private\TestApp\node_modules\capture-electron/script/render.js' 'https://twitter.com/' 1024 768 0 png
The filename, directory name, or volume label syntax is incorrect.
at ChildProcess.exithandler (child_process.js:289:12)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:606:12)
(node:9444) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9444) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I noticed that this package installed capture-electron
but this error says it tries to access node_modules\electron
. Could that be the reason?
Just for giggles, i installed electron
and i got slitly different error:
(node:33936) UnhandledPromiseRejectionWarning: Error: Command failed: 'C:\Users\PragmaticEd\workspace\_private\TestApp\node_modules\capture-electron\node_modules\electron\dist\electron.exe' 'C:\Users\PragmaticEd\workspace\_private\TestApp\node_modules\capture-electron/script/render.js' 'https://twitter.com/' 1024 768 0 png
The filename, directory name, or volume label syntax is incorrect.
at ChildProcess.exithandler (child_process.js:289:12)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:606:12)
(node:33936) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:33936) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Note how, before i installed electron
, it was checking for node_modules\electron\dist\electron.exe
, but after i installed electron, it started checking: node_modules\capture-electron\node_modules\electron\dist\electron.exe
Platform: WIndows 10
When i screenshot the url that contain with avg files, the avg not showing the right way , some are missing and some are not full image load. thanks
I'm creating a discord bot. One of its features is the ability to grab a screnshot from http://jef.works/picture-quote-generator
and paste that in your current channel. The bot is running on an ubuntu server, but appears to be genorating white squares with question marks like this
note: this IS in my bot startup script, I copied and pasted it from a phantomjs thread due to another error it was throwing: QT_QPA_PLATFORM=offscreen
Code genorating these white squares:
screenshot('http://jef.works/picture-quote-generator/')
.width(800)
.height(600)
.capture(function(err, img) {
if (err) throw err;
file = Math.round((new Date()).getTime() / 1000);
fs.writeFileSync('/var/www/html/host/gcore/quotes/'+file+'.png', img);
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
I created a file, 'screenshot.js' which has the code given in the docs.
From the command line when i run node screenshot.js, the command prompt hangs.
Can u please help me?
It looks a bit more convenient use npm version of phantomjs.
Need just instead exec('phantomjs use
var phantomjs = require('phantomjs')
var binPath = phantomjs.path
exec(binPath
Or something like this (i did not check).
Thanks
I have list of urls and want to process them line by line, but by default url-to-screenshot process them asynchronously which highly resource consumed when all url being captured together at the same time (even hang my pc in my case).
is the any way to call capture() synchronously ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.