How to take a screenshot from a specified site?

I want to know the screen capture technique if I have the URL of these sites like google fastflip . What technologies or methods are required for this kind of task. If this technique was available on rails, that would be great.

thanks

+3
source share
3 answers

To do this, you will need an HTML rendering engine .
An easy way is to use a browser plugin for this task.

Take a look: 15 ways to take screenshots of a site

+1
source

, - Xvfb. , Ubuntu:

sudo apt-get install xvfb imagemagick x11-apps

, sudo " ", :

/usr/bin/sudo -u nobody /path/screengrab.sh www.ibm.com 34344 >>/tmp/screengrab.log 2>&1

..

#!/bin/bash

rm -rf /home/nobody/.mozilla/

XAUTHORITY=

Xvfb :$2 -pixdepths 32 -screen 0 1024x1024x24 >/dev/null 2>&1 &
XPID=$!

sleep 1

firefox -width 2000 -height 1024 --display :$2 http://$1 &
FPID=$!

sleep 6
xwd -display :$2 -root -out /tmp/$2-$$.xwd

convert /tmp/$2-$$.xwd /u0/screengrabs/$1.png # Cache
convert -resize 300x300 /tmp/$2.xwd /tmp/$2-$$.png
convert -crop 287x248+0+29 /tmp/${2}-$$.png /tmp/${2}2-$$.png

mkdir -p /home/je/www/domaintool.se/docs/images/$1
cp /tmp/${2}2-$$.png /home/je/www/domaintool.se/docs/images/$1/`date +%Y%m%d`.png
rm -f /tmp/$2-$$.png /tmp/$2-$$.xwd /tmp/${2}2-$$.png

kill $XPID >/dev/null 2>&1
kill $FPID >/dev/null 2>&1
+1

Firefox Grab Them All https://addons.mozilla.org/en-US/firefox/addon/7800/, , Screengrab.

URL-, . -.

URL- Google Maps, , - .. - . , .

+1

Source: https://habr.com/ru/post/1720256/


All Articles