当我将webdriver send_keys
用于此网站的密码字段时出现问题:https://fx.yiji.com
我可以专注于密码字段,但send_keys
命令不能在此字段上运行。!
代码:
import os
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
iedriver = 'C:\Program Files\Internet Explorer\IEDriverServer.exe'
os.environ['webdriver.ie.driver'] = iedriver
browser = webdriver.Ie(iedriver)
browser.get('https://fx.yiji.com')
click_login = browser.find_element_by_id('forLogin')
click_login.send_keys(Keys.RETURN)
user = browser.find_element_by_name('username')
user.send_keys('my_email')
password = browser.find_element_by_css_selector('.text.ignore.js-pass-guard')
password.send_keys('my_password')