如何使用硒通过metAmask与JavaScript Web3页面进行交互

发布于 2025-01-28 09:37:18 字数 640 浏览 2 评论 0原文

我正在尝试通过将MetAmask连接到DAPP来使用硒,我能够使用Chromium Extension设置MetAmask,但是我很难通过下面的MetAmask选项单击连接按钮: https://wwwww.premint.xyz/login/?next=/afterlif3-rif3-raffle/

因此,我可以通过以下内容找到连接按钮,但我不太确定如何选择MetAmask选项。

driver.get(link)
continue_link = driver.find_element_by_link_text('Connect')
continue_link.click()
button = driver.find_element_by_xpath("//button[@class='btn btn-styled btn-base-1 btn-circle']")
button.click()

基本上,我要做的是尝试将MetAmask钱包与此站点联系起来。我绝对会感谢任何帮助

I'm trying to use selenium by connecting metamask to a dapp, I am able to set up metamask using the chromium extension, but i'm having difficulty clicking on the connect button via the metamask option below: https://www.premint.xyz/login/?next=/afterlif3-raffle/

So I am able to locate the connect button via the following but im not too sure how to choose the metamask option.

driver.get(link)
continue_link = driver.find_element_by_link_text('Connect')
continue_link.click()
button = driver.find_element_by_xpath("//button[@class='btn btn-styled btn-base-1 btn-circle']")
button.click()

Basically what I want to do is to try and connect the metamask wallet with this site. I would definitely appreciate any help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

抽个烟儿 2025-02-04 09:37:18

我认为您的相对XPath错误。

button = driver.find_element_by_xpath("//button[@title='Login with MetaMask']")

因此,它对我有用。

I think you got the relative xpath wrong.

button = driver.find_element_by_xpath("//button[@title='Login with MetaMask']")

with this it worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文