Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium Python TimeoutException:消息:selinium_Selenium_Selenium Webdriver_Firefox_Twitter_Webautomation - Fatal编程技术网

Selenium Python TimeoutException:消息:selinium

Selenium Python TimeoutException:消息:selinium,selenium,selenium-webdriver,firefox,twitter,webautomation,Selenium,Selenium Webdriver,Firefox,Twitter,Webautomation,我是python的初学者,我想用selinium学习一点twitter自动化,但当这个错误出现时,我遇到了死胡同。 有什么帮助吗 from selenium import webdriver from selenium.webdriver.firefox.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By

我是python的初学者,我想用selinium学习一点twitter自动化,但当这个错误出现时,我遇到了死胡同。 有什么帮助吗

from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC


class Twitterbot:
    def __init__(self,email,password):
        self.email=email
        self.password=password
        options = Options()
        options.binary_location = r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'
        self.bot = webdriver.Firefox(firefox_options=options, executable_path=r'C:\Users\ok\AppData\Local\Programs\Python\Python38-32\geckodriver.exe')
        
    def login(self):
        bot=self.bot
        bot.get('https://twitter.com/')
        WebDriverWait(bot, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "input.js-username-field.email-input.js-initial-focus[name='session[username_or_email]']"))).send_keys(self.username)
        bot.find_element_by_css_selector("input.js-password-field[name='session[password]']").send_keys(self.password)
       
        
        
run = Twitterbot('jimfox@gmail.com', 'jimmyjones50')
run.login()