--javascript-delay for doing a screenshot using imgkit and Python

1.5k Views Asked by At

Using Python, imgkit and wkhtmltopdf (2.0) library I'm trying to make a screenshoot for the whole page. After some preparation I'm calling a method make_screenshot:

def make_screenshot(url):
   options = {
    'format': 'png',
    'javascript-delay': '2000',
}

return imgkit.from_url(url, False, options=options)

But when it runs I'm obtaining an error like this:

Loading page (1/2)
Rendering (2/2)                                                    
Warning: Received createRequest signal on a disposed ResourceObject's NetworkAccessManager. This might be an indication of an iframe taking too long to load.
Done  

Screenshot, which is created, shows that page isn't fully loaded. How to resolve it?

0

There are 0 best solutions below