我试图在PyCharm社区版2018.8.2中导入硒,这给了我这个错误:
from selenium import webdriver
from getpass import getpass
usr = input('Enter your username or email : ')
pwd = getpass("Enter your password : ")
driver = webdriver.Chrome()
driver.get('https://twitter.com/login')
usr_box = driver.find_element_by_class_name('js-username-field')
usr_box.send_keys(usr)
pwd_box = driver.find_element_by_class_name('js-username-field')
pwd_box.send_keys(pwd)
login_button = driver.find_element_by_css_selector('button.submit.EdgeButton.EdgeButton--
primary.EdgeButtom--medium')
login_button.submit()
答案 0 :(得分:0)
使用以下方法检查是否已安装硒:
sudo pip3 install selenium #for python3
或者:
sudo pip install selenium #for python2