View Single Post
Old 02-14-2020, 02:37 AM   #11
Akeras
Junior Member
Akeras began at the beginning.
 
Posts: 5
Karma: 12
Join Date: Feb 2020
Device: None
QTest for Calibre?

Thanks Kovidgoyal! Your solution works.

I worked a bit on the recipe and managed to have a parser giving some results on my own python kernel. It is not straightforward since the website is sending the "finish loading" signal before the javascript is loaded and not after.

I designed a function that wait until some given elements are found into the pages before running further. This cannot be done with
Code:
time.sleep()
since the webpage becomes unresponsive and the page is not loading anymore. So it seems to work if I use

Code:
from PyQt5 import QtTest
QtTest.QTest.qWait(XXX)
I basically loop over QTest until I find specific keys in the html of the page.

But QTest is not part of the modules one can import in Calibre...
Any idea how to go around that? I could not make QTimer works since the code outside of the timer continues to run: QTimer seems to open a new thread when running the code.
Akeras is offline   Reply With Quote