Skip to main content
se añadieron 118 caracteres en el cuerpo
Origen Enlace
fedorqui
  • 16.7k
  • 24
  • 71
  • 134

Me salta un error de identacion from selenium import webdriver from selenium.webdriver.commonidentación.keys import Keys import time

class TwitterBot: def init(self,username, password) Este es mi código: self.username=username self.password = password self.bot=webdriver.Firefox()

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

class TwitterBot:
    def __init__(self,username, password):
            self.username=username
            self.password = password
            self.bot=webdriver.Firefox()


    def login(self):
            bot=self.bot  
            bot.get("https://twitter.com")
            time.sleep(3)
            email=bot.find_element_by_class_name("email-input")
            password=bot.find_element_by_name("session[password]")
            email.clear()
            password.clear()
            email.send_keys(self.username)
            password.send_keys(self.password)
    
Alex = TwitterBot("[email protected]", "xxxxxx")
Alex.login()

Alex = TwitterBot("[email protected]", "xxxxxx") Alex.login()

Me salta un error de identacion from selenium import webdriver from selenium.webdriver.common.keys import Keys import time

class TwitterBot: def init(self,username, password): self.username=username self.password = password self.bot=webdriver.Firefox()

def login(self):
        bot=self.bot  
        bot.get("https://twitter.com")
        time.sleep(3)
        email=bot.find_element_by_class_name("email-input")
        password=bot.find_element_by_name("session[password]")
        email.clear()
        password.clear()
        email.send_keys(self.username)
        password.send_keys(self.password)

Alex = TwitterBot("[email protected]", "xxxxxx") Alex.login()

Me salta un error de identación. Este es mi código:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

class TwitterBot:
    def __init__(self,username, password):
            self.username=username
            self.password = password
            self.bot=webdriver.Firefox()


    def login(self):
            bot=self.bot  
            bot.get("https://twitter.com")
            time.sleep(3)
            email=bot.find_element_by_class_name("email-input")
            password=bot.find_element_by_name("session[password]")
            email.clear()
            password.clear()
            email.send_keys(self.username)
            password.send_keys(self.password)
    
Alex = TwitterBot("[email protected]", "xxxxxx")
Alex.login()
Origen Enlace

Error de identacion

Me salta un error de identacion from selenium import webdriver from selenium.webdriver.common.keys import Keys import time

class TwitterBot: def init(self,username, password): self.username=username self.password = password self.bot=webdriver.Firefox()

def login(self):
        bot=self.bot  
        bot.get("https://twitter.com")
        time.sleep(3)
        email=bot.find_element_by_class_name("email-input")
        password=bot.find_element_by_name("session[password]")
        email.clear()
        password.clear()
        email.send_keys(self.username)
        password.send_keys(self.password)

Alex = TwitterBot("[email protected]", "xxxxxx") Alex.login()