我试图用cutycapt捕获一些包含Adobe Flash元素的网站,但没有运气。
我的PHP脚本:
$url=escapeshellarg($url);
$filename=escapeshellarg($filenamebase);
$format=escapeshellarg($format);
$useragent=escapeshellarg($useragent);
$cmd = "xvfb-run --server-args=\"-screen 0, ".$width."x".$height."x24\" CutyCapt --url=$url --out=$filename --out-format=$format --user-agent=$useragent --plugins=\"on\" --delay=5000 --javascript=$js";
exec($cmd);例如,如果我想要捕获http://flashhry.cz/h/kingdom-rush,我的脚本将在shell中运行以下命令:
xvfb-run --server-args="-screen 0, 1024x5000x24" CutyCapt --url='http://sk.search.etargetnet.com/cookie.php?eURL=http%3A%2F%2Fflashhry.cz%2Fh%2Fkingdom-rush' --out='./screens/http_flashhry.cz_h_kingdom-rush.png' --out-format='png' --user-agent='Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0' --plugins="on" --delay=5000 --javascript=on输出(http://prntscr.com/5pxc7e)没有闪存
命令stdout为:
Xlib: extension "RANDR" missing on display ":99".无错误输出。
我需要它在Ubuntu6服务器上运行,但我的CentOS桌面也有类似的结果。
发布于 2015-01-21 06:42:08
https://github.com/jaequery/php-site-screenshot
也请注意Ubuntu的安装脚本。它可能还会让您对CentOS的依赖关系有一个了解。
https://github.com/jaequery/cutycapt-installer-script-on-ubuntu/blob/master/install
如果它仍然失败,我会认为CentOS 6可能太旧了,不能满足要求。
https://stackoverflow.com/questions/27842154
复制相似问题