How can I take fullscreen screenshot of website [c

2019-02-05 07:10发布

I need to get fullscreen shot of website by URL, is there any PHP programs for that or services, if not, is there any Java programs for that purpose?

8条回答
Explosion°爆炸
2楼-- · 2019-02-05 07:46

Litmus is a great online resource for this kind of thing; you can submit a URL and have it take full-page screenshots on the latest browsers. If you get a paid subscription or use it on weekends, you'll have access to test on all 22 of its browsers instead of just the most recent. I use this website all the time, I think it's phenomenal.

BrowserShots is also great, and it supports tons more browsers, but in my experience it's a lot slower too. It's good to use if you need to test some browser Litmus doesn't, though.

查看更多
干净又极端
3楼-- · 2019-02-05 07:57

It's not clear from the question whether you're looking to do this programatically or manually. If manually: there is a great plug-in for Firefox called Abduction! that renders a page as an image. Otherwise, Kane's answers have it pretty much covered.

查看更多
Deceive 欺骗
4楼-- · 2019-02-05 08:00

Try a headless browser. Any one of these should do it:

  • PhantomJS -> uses 'Webkit' layout engine (Safari/Chromium)
  • TrifleJS -> uses 'Trident' layout engine (Internet explorer)
  • SlimerJS -> uses 'Gecko' layout engine (Firefox)

You can take a screenshot by using following javascript code (saved to file renderpage.js):

var page = require('webpage').create();
page.open('http://en.wikipedia.org', function() {
    page.render('wikipedia.png');
});

Then execute via command line:

> phantomjs.exe renderpage.js

This will create a file wikipedia.png with your screenshot.

查看更多
ゆ 、 Hurt°
5楼-- · 2019-02-05 08:02

You can also do it yourself if you had a dedicated server. The idea is to launch a X Server and a browser in fullscreen mode, to take a shot, and save it into an image file.

Depending of your utilisation (occasional or intensive), you can adapt the process (i.e. not killing X everytime, etc...) to make it faster.

查看更多
beautiful°
6楼-- · 2019-02-05 08:05

I found out that CutyCapt is the most easiest solution to take screenshots and it will work in Windows and Linux.

Installinging in Windows:

Just download file and execute.

Installining in debian:

apt-get install cutycapt xvfb

and running:

xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/cutycapt --url=http://www.google.com --out=/home/screenshots/screenshot_name.png
查看更多
欢心
7楼-- · 2019-02-05 08:10

You need to have a special version of a browser to "render" the page after it's processed by PHP or Java.

You'll most-likely need to set up some custom automation scripts to hit a URL after you ping a server running windows, OSX or a Linux window manager.

There are services out there which will do screen shots for you.

http://www.browsercam.com

http://webthumb.bluga.net/home

to name a few.

查看更多
登录 后发表回答