jeanphix/Ghost.py

QPixmap is not safe to use

Closed this issue · 2 comments

Hi,

I'm using Ghost-0.2.3, I integrate it into my project with the following code :

from ghost import Ghost
ghost = Ghost()

with ghost.start() as session:
    page, extra_resources = session.open(url)

ghost.capture_to("/tmp/web.png")

And I got the following error :

 - qt - WARNING - QPixmap: It is not safe to use pixmaps outside the GUI thread
[WARNING ] QT: QPixmap: It is not safe to use pixmaps outside the GUI thread

And obviously no file has been created.

So...What's wrong ?

PS: PySide-1.2.4

Never mind, that's better to use selenium and its headless.

http://rachbelaid.com/capturing-screenshots-of-website-with-python/

You just needed to use capture_to in the session context.