seleniumbase / SeleniumBase

📊 Python's all-in-one framework for web crawling, scraping, testing, and reporting. Supports pytest. UC Mode provides stealth. Includes many tools.
https://seleniumbase.io
MIT License
4.46k stars 910 forks source link

How to handle and dismiss Interstitials Overlay Ads in website? #2899

Closed PankajSavaliya closed 4 days ago

PankajSavaliya commented 4 days ago

Hi, I'm new to SeleniumBase. How can I find an iframe and dismiss overlay ads after clicking on any element on the web, which then triggers an interstitial overlay ad? I want to dismiss this ad by clicking a button.

Screenshot 2024-07-03 at 5 28 07 PM
mdmintz commented 4 days ago

Determine the CSS Selector of the X and then click that after switching into the iframe with sb.switch_to_frame()

You can also try the --ad-block / ad_block=True option.

PankajSavaliya commented 4 days ago

Determine the CSS Selector of the X and then click that after switching into the iframe with sb.switch_to_frame()

You can also try the --ad-block / ad_block=True option.

I don't want to block the ads, that's why.