【发布时间】:2015-01-08 14:13:10
【问题描述】:
我正在尝试使用 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 中运行这个 cmd:
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) 没有闪光灯
命令标准输出是:
Xlib: extension "RANDR" missing on display ":99".
没有错误输出。
我需要它在 CentOS 6 服务器上工作,但我的 Ubuntu 桌面也有类似的结果。
【问题讨论】:
-
我向 CutyCapt 的作者询问了关于捕获 Flash 内容的问题,他确认至少当前版本不支持。
-
还有其他选择吗?除了 webkit2png - 我无法让它工作。
-
有些替代品,看here,我没测试过。