diff --git a/playwrightcapture/capture.py b/playwrightcapture/capture.py index 2ea3df7..8c4f058 100644 --- a/playwrightcapture/capture.py +++ b/playwrightcapture/capture.py @@ -474,7 +474,7 @@ async def handler() -> None: if await page.locator("#didomi-notice-agree-button").is_visible(): await page.locator("#didomi-notice-agree-button").click(timeout=2000) - await page.add_locator_handler(page.locator(".didomi-popup-view").last, handler) + await page.add_locator_handler(page.locator(".didomi-popup-view").last, handler, times=1, no_wait_after=True) self.logger.info('Didomi handler added') async def __dialog_onetrust_clickthrough(self, page: Page) -> None: @@ -484,7 +484,8 @@ async def handler() -> None: await page.add_locator_handler( page.locator('#onetrust-banner-sdk').last, - handler + handler, + times=1, no_wait_after=True ) self.logger.info('OT handler added') @@ -495,7 +496,8 @@ async def handler() -> None: await page.add_locator_handler( page.locator('#hs-eu-cookie-confirmation').last, - handler + handler, + times=1, no_wait_after=True ) self.logger.info('HS handler added') @@ -506,7 +508,8 @@ async def handler() -> None: await page.add_locator_handler( page.locator('#CybotCookiebotDialogBody'), - handler + handler, + times=1, no_wait_after=True ) self.logger.info('Cookiebot handler added') @@ -522,7 +525,8 @@ async def handler() -> None: await page.add_locator_handler( page.get_by_role("alertdialog").last, - handler + handler, + times=1, no_wait_after=True ) self.logger.info('alert dialog handler added') @@ -541,7 +545,8 @@ async def handler() -> None: self.logger.info('Consent window found, but no button to click through.') await page.add_locator_handler( page.get_by_role("dialog").last, - handler + handler, + times=1, no_wait_after=True ) self.logger.info('dialog handler added') @@ -552,7 +557,8 @@ async def handler() -> None: await page.add_locator_handler( page.locator('.cmplz-show'), - handler + handler, + times=1, no_wait_after=True ) self.logger.info('Complianz handler added') @@ -563,7 +569,8 @@ async def handler() -> None: await page.add_locator_handler( page.locator('.con-wizard'), - handler + handler, + times=1, no_wait_after=True ) self.logger.info('Yahoo handler added') @@ -574,7 +581,8 @@ async def handler() -> None: await page.add_locator_handler( page.locator('#ppms_cm_popup_overlay'), - handler + handler, + times=1, no_wait_after=True ) self.logger.info('Yahoo handler added') diff --git a/poetry.lock b/poetry.lock index afe4e08..9401fab 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1401,13 +1401,13 @@ files = [ [[package]] name = "requests" -version = "2.32.2" +version = "2.32.3" description = "Python HTTP for Humans." optional = true python-versions = ">=3.8" files = [ - {file = "requests-2.32.2-py3-none-any.whl", hash = "sha256:fc06670dd0ed212426dfeb94fc1b983d917c4f9847c863f313c9dfaaffb7c23c"}, - {file = "requests-2.32.2.tar.gz", hash = "sha256:dd951ff5ecf3e3b3aa26b40703ba77495dab41da839ae72ef3c8e5d8e2433289"}, + {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, + {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, ] [package.dependencies] @@ -1537,13 +1537,13 @@ files = [ [[package]] name = "typing-extensions" -version = "4.11.0" +version = "4.12.0" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.11.0-py3-none-any.whl", hash = "sha256:c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a"}, - {file = "typing_extensions-4.11.0.tar.gz", hash = "sha256:83f085bd5ca59c80295fc2a82ab5dac679cbe02b9f33f7d83af68e241bea51b0"}, + {file = "typing_extensions-4.12.0-py3-none-any.whl", hash = "sha256:b349c66bea9016ac22978d800cfff206d5f9816951f12a7d0ec5578b0a819594"}, + {file = "typing_extensions-4.12.0.tar.gz", hash = "sha256:8cbcdc8606ebcb0d95453ad7dc5065e6237b6aa230a31e81d0f440c30fed5fd8"}, ] [[package]]