[Python] How to switch to a popup cookie consent page?

Discussão em 'Python' iniciado por Stack, Abril 12, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using Python 3.12.3, Selenium 4.31.0, Firefox driver in Ubuntu 24.04. When I try to open an url, a cookie consent popup, asking to continue without accepting, accept and more options. How can I switch to the popup and click on continue without accepting, so the popup can be closed and continue to the main content? I'm new to this, can someone confirm if the popup is an alert, a frame or something else? Based on what I see, the tag on the button is

    <button type="button" class="iubenda-cs-close-btn" tabindex="0" role="button" aria-pressed="false">Continue without Accepting</button>


    and the css path is

    html body.absolute-header.has-search-v2.cc-tbp-sdmap.has-widget-bubble.styleTravelBackpack.cc-tbp-fav-tooltip div#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default.iubenda-cs-bottom.iubenda-cs-overlay.iubenda-cs-slidein.iubenda-cs-no-heading.iubenda-cs-visible div.iubenda-cs-container div.iubenda-cs-content div.iubenda-cs-rationale div.iubenda-banner-content.iubenda-custom-content div#iubenda-cs-title button.iubenda-cs-close-btn


    Is it alert or frame or something else?

    Continue reading...

Compartilhe esta Página