<分区>
我在以下位置遵循了已接受答案的解决方案: 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,然后在几秒钟后刷新,然后什么也没有发生。