Replies: 1 comment
-
Hi @un1tz3r0 , do you have an equivalent example of code for playwright? I can take a look and see if there's a way to do that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to scrape a website which sometimes shows a modal popover which I need to dismiss before continuing to interact with the page. I could just wait for the popover element with a timeout, but I'd like to avoid waiting the timeout every time since it only appears occasionally, so what I'm thinking is, inject javascript which sets up a MutationObserver, and in the MutationObserver's callback, somehow trigger an event listener in my python script that can then find the popover's dismiss button and click it.
I know that playwright has a page.exposeFunction method which allows a python callback to be made visible to content scripts running in the browser, so a MutationObserver callback function can trigger python code by calling a function exposed with it.
What is the correct way to do this using pydoll? I know it has an extensive event handling api, but none of the events seem appropriate for sending custom events from javascript code to a handler on the python side. Am I missing something there?
Thanks in advance for your help with this.
Beta Was this translation helpful? Give feedback.
All reactions