Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

211
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!