Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dp 和 metamask 交互时,获取不到元素,用selenium能正常交互 #215

Open
test4cz opened this issue May 7, 2024 · 0 comments

Comments

@test4cz
Copy link

test4cz commented May 7, 2024

测试地址
https://content-hub.readon.me/detail/3702566
插件 metamask

    tab = page.get_tab(title='MetaMask')
    tab.wait.doc_loaded()
    time.sleep(50)
    # testx = page.ele('x://*[@id="password"]')
    # print(testx)
    pwd=tab.ele('x://*[@id="password"]')
    print(pwd)
    tab.ele('x://*[@id="password"]').input('11111111')
    tab.ele('x://*[@id="app-content"]/div/div[1]/div/div/button').click()

selenium:
     driver.switch_to.window(driver.window_handles[1])
     driver.find_element(By.ID, "password").send_keys('11111111', Keys.ENTER)

问题原因:
  都能切换到对应的tab页,通过打印 tite ,url 两者表现都一致,但打印的源码不一致
   
![image](https://github.com/g1879/DrissionPage/assets/3381219/3ef0a894-9fd2-4efa-bf40-bdfa96d1b2c9)

推测有可能是script async 导致,但没有找到解决方案,求指教
     
     
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant