Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

213
Vistas
how to swicth to a metamask pop up in chrome with a python selenium script

i am on rarible.com minting a nft with metamask

i go threw the hole process then in the chrome browser a metamask pop up appears to click confirm the transaction, then a second to confirm agaian, it all used to runs smothly but now i can not seem to switch to the metamask mask pop up that appears in chrome

the way it works on rarible.com is you

  1. fill details and click create button (this works fine)
  2. a modal box appears overlaying the page and goes there the procees of upload to ipfs, then confirm metamask in step (3)
  3. metamask pop up appears (i can not focus to this to click the button needed)
  4. second metamask pop up appears (same as above)

this is my code that did before switch to the metamask pop up in chrome, but now i its not workin

is there a easier why to detect the window handles and define the metamask one easier, so i can click the elements i need in it??

    main_page = driver.current_window_handle
    while True:
        try:
            time.sleep(10) ###adjust this depending on your uplaod speed
            for handle in driver.window_handles:
                if handle != main_page:
                    login_page = handle
            driver.switch_to.window(login_page)
            css_and_click("button[class='button btn--rounded btn-primary btn--large']")
            driver.switch_to.window(main_page)
            break
        except Exception as wtf:
            #print(wtf)
            print("----- Waiting for metamask sign window -----")
            continue

heres a link to the full code i am using https://github.com/cloudmaking/Auto_Chrome_2/blob/main/Sample_Presets/rarible_metamask_v4.py

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda