Replies: 1 comment 7 replies
-
Hi, Don't worry, discussions are the right place to ask questions. For adding delay, the from html2image import Html2Image
hti = Html2Image(
custom_flags=['--virtual-time-budget=10000']
)
hti.screenshot(url="http://example.com", save_as='example.png') In this example, you allow the page to load for a maximum of 10 seconds. The I'll see what can be done for the cookie modals and I'll get back to you. Edit: I don't see any easy way to get rid of modals. It is possible to get rid of them using extensions but Chrome headless cannot be launched with extensions. A workaround would be to GET the source code of the page, get rid of the code that makes the modal appear and feed the remaining code to html2image. |
Beta Was this translation helpful? Give feedback.
-
Morning,
Its a really nice library - I was wondering if there there is a delay function? I have a page that takes time to load so I need to delay the screenshot?
This then leads onto any other functions, such as ticking cookies on pages etc? for example grabbing a screenshot of the news.bbc.co.uk or washingtonpost.com does not work as the sites pop up cookies etc for the first time user?
Hope its ok to ask,
Andy
Beta Was this translation helpful? Give feedback.
All reactions