I am a beginner in python and I wanted to learn a little bit of twitter automation with selinium but I hit a dead end when this error came up. any help?
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()