I want to take screenshot from my web automatically using crontab. I have installed cutycapt on my server. But I get this error when running it :
My question is :
I'll be grateful if there is any one who can explain this to me. Thanks.
To get it to work in a "headless" environment I used xvfb, I'd already installed xserver, but I do not believe it is required. I did not intentionally install phantomjs, but it may be a dependancy.
sudo apt-get install xvfb cutycapt
And I then launched cutycapt in an xvfb framebuffer and sent some arguments. This is taken from the cutycapt source forge usage page.
xvfb-run --server-args="-screen 0, 1024x768x24" cutycapt --url=website.com --out=image.png
I also wrote a little script to make it even easier. It asks you which page to download. saves it as as the the url.png
#!/bin/bash
echo what is the website you would like to grab?
read url
echo grabbing $url please wait...
xvfb-run --server-args="-screen 0, 1024x768x24" cutycapt --url=$url --out=$url.png
echo done, image is $url.png