ここに私のコードです。ImportError:名前 'webdriver'をインポートできません。
import sys
print (sys.path)
from selenium import webdriver
from selenium.webdriver.common.by import BY
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
usernameStr = 'email'
passwordStr = 'password'
browser = webdriver.Chrome()
browser.get('http://website.com')
username = browser.find_element_by_xpath('//*[@id="did-ui"]/div/div/section/section/form/section/div[1]/div/label/span[2]/input')
username.send_keys(usernameStr)
password = browser.find_element_by_xpath('//*[@id="did-ui"]/div/div/section/section/form/section/div[2]/div/label/span[2]/input')
password.send_keys(passwordStr)
nextButton = browser.find_element_by_xpath('//*[@id="did-ui"]/div/div/section/section/form/section/div[3]/button[1]')
nextButton.click()
私はそれを実行すると、私はこのエラーを取得する私はエラーを取得しておく理由は、
['/Users/austinjohnson/Desktop/streakscraper', '/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python36.zip', '/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6', '/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/site-packages']
Traceback (most recent call last):
File "/Users/austinjohnson/Desktop/streakscraper/login.py", line 6, in <module>
from selenium import webdriver
ImportError: cannot import name 'webdriver'
[Finished in 0.1s with exit code 1]
[cmd: ['/usr/local/bin/python3', '-u', '/Users/austinjohnson/Desktop/streakscraper/login.py']]
[dir: /Users/austinjohnson/Desktop/streakscraper]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
は私が把握することはできません。私はアクセスを与えるためにパスを変更しようとしましたが、まだエラーが発生します。たぶん私は間違ったことをしましたが、私はそれを理解できません。
私はすでにそれを確認しました。セレンという名前のファイルはありません。 – tin