gpt4 book ai didi

python - 使用 Selenium 登录

转载 作者:太空宇宙 更新时间:2023-11-04 10:38:07 24 4
gpt4 key购买 nike

<分区>

我在以下位置遵循了已接受答案的解决方案: How to use Selenium with Python?

我正在尝试登录 coinbase https://coinbase.com/signin

这是我的代码

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException


site = "https://coinbase.com/signin"
email = "myemail@mymail.com"
password = "mypassword"

xpaths = {
'emailTxtBox' : '/html/body/div[2]/div[2]/div[2]/div/div/form/div[2]/div/input',
'passwordTxtBox' : '/html/body/div[2]/div[2]/div[2]/div/div/form/div[3]/div/input',
'submitButton' : '/html/body/div[2]/div[2]/div[2]/div/div/form/div[4]/div/input'
}

browser = webdriver.Firefox()
browser.get(site)

#Write Username in Username TextBox
mydriver.find_element_by_xpath(xpaths['emailTxtBox']).send_keys(email)

#Write Password in password TextBox
mydriver.find_element_by_xpath(xpaths['passwordTxtBox']).send_keys(password)

#Click Login button
mydriver.find_element_by_xpath(xpaths['submitButton']).click()

我运行它,selenium 打开 coinbase,然后在几秒钟后刷新,然后什么也没有发生。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com