pythonスクリプトを使用してChromeでGmailにログインしますが、次のコードをクリックしてエラーを返した後、誰でも助けてください。以下は私が使用したコードです。pythonを使用してWindowsでchromeを使用してGmailにログインする方法
トレースバック(最後の最新の呼び出し):: ファイルの下
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.select import Select
import threading
import os,time,csv,datetime
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
a = webdriver.Chrome()
a.get("https://accounts.google.com/")
user = a.find_element_by_id("Email")
user.send_keys('[email protected]')
login = a.find_element_by_id("next")
login.click()
pwd = WebDriverWait(a, 10).until(EC.presence_of_element_located((By.ID, "Passwd")))
pwd.send_keys('p######')
login = a.find_element_by_id("signIn")
login.click()
clk = WebDriverWait(a, 10).until(EC.presence_of_element_located((By.LINK_TEXT, 'myaccount')))
clk.click()
logout = WebDriverWait(a, 10).until(EC.presence_of_element_located((By.ID, "gb_71")))
logout.click()
は誤りである "C:\ Users \ユーザーmapraveenkumarのPythonの\ gmail.py \ドキュメント\" のCLK =で、ライン20、 ファイル "C:¥Users¥mapraveenkumar¥AppData¥Local¥Programs¥Python¥Python36-32¥lib¥site-located((By.LINK_TEXT、 'myaccount'))) ファイル" C:¥Users¥mapraveenkumar¥AppData¥Local¥Programs¥Python¥Python36-32¥lib¥site- (メッセージ、画面、スタックトレース) まで selenium.common.exceptions.TimeoutException:メッセージ:
[パッケージ\ selenium \ webdriver \ support \ wait.py]
エラーを追加してください。.. – franklinsijo
を、これは誤りです:ファイル "C:/Users/mapraveenkumar/Documents/Python/gmail.py"、ライン12を、 PWDに= a.find_element_by_css_selector( "#Passwd") ファイル "C:¥Users¥mapraveenkumar¥AppData¥Local¥Programs¥Python¥Python36-32¥lib¥site-packages¥selenium¥webdriver¥remote¥webdriver.py" 437行目、in find_element_by_css_selector return self.find_element(by = .CSS_SELECTOR、値= css_selector) –
ここでのコメントではなく、エラーのある投稿を更新してください。あなたが掲示したコードが間違っていると、 – franklinsijo