I work with PyQt (as a Python beginner). I need to take screenshots of a website in a headless system. I used to use PhantomJS for another project, but they refused to support Flash in 1.5, and I do not want to rely on the outdated version 1.4 for my new project.
So, I use PyQt to do my own things. I can take a screenshot from the site with the given URL, no problem.
But I still have the plugin icon for the βblue diceβ on the flash placeholder (yes, javascript and plugins are activated)
self.settings.setAttribute(QtWebKit.QWebSettings.PluginsEnabled,True) self.settings.setAttribute(QtWebKit.QWebSettings.JavascriptEnabled,True)
I am doing some tests on the Youtube video page, here is an example of my problems:

The second part, which may be related to the first: How can I tell PyQt to wait a few seconds before taking a screenshot? As you can see from the example, the images on the right are still unloaded, because they are loaded using the javascript attribute and data, and in my script I take a screenshot of the signal loadFinished ( onLoad () is the equivalent of javascript)).
My first guess was just
time.sleep(2)
Before calling my capture method, but it does not work. I assume that loading Webkit also sleeps during this sleep time, which prevents the page from loading.
I tried to create a custom signal, but then I still do not know how to call it without sleep.
My last assumption is that I need to shed my application. I'm right?
If you have a hint / script to help me display flash content and / or add a setTimeout signal, I would really appreciate it!
Thanks in advance for your help.
EDIT: Just add my solution:
timeoutTimer = QTimer() timeoutTimer.setInterval(3000) # wait for 3secs timeoutTimer.setSingleShot(True) timeoutTimer.timeout.connect(theMethodToCallOnTimeout)
About the flash movie: it looks like the flash player is broken on OSX (possibly due to a 32/64 bit problem).