Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
不包括使用python ghost.py的图像的屏幕截图_Python_Python 2.7_Ghost.py - Fatal编程技术网

不包括使用python ghost.py的图像的屏幕截图

不包括使用python ghost.py的图像的屏幕截图,python,python-2.7,ghost.py,Python,Python 2.7,Ghost.py,我正在使用ghost.py拍摄网页截图。但是脚本没有捕获页面上的任何图像。我已将download_images=True设置为-但这似乎不起作用 我的代码: from ghost import Ghost ghost = Ghost(wait_timeout=4, download_images = True) #download_images not working ghost.open('http://sex-offender.vsp.virginia.gov/sor/policy.ht

我正在使用ghost.py拍摄网页截图。但是脚本没有捕获页面上的任何图像。我已将download_images=True设置为-但这似乎不起作用

我的代码:

from ghost import Ghost

ghost = Ghost(wait_timeout=4, download_images = True) #download_images not working

ghost.open('http://sex-offender.vsp.virginia.gov/sor/policy.html')

ghost.capture_to('page.png')

我无法复制您的问题,它在我这边没有问题。我正在使用Python 3。

为后代:


只有在使用python 2.7时才会出现此问题。如果您使用Python3.3,没有问题。

我刚刚用Python3试一试,它成功了。我用的是2.7。