Python Forum
Trying to make a bot to connect on discord with Selenium Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to make a bot to connect on discord with Selenium Python
#1
Trying to make a bot to connect on discord with Selenium Python: I've been trying to make a bot to connect to my discord.

Imports needed are listed below:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
The following code is my script - defining DiscordBot:

class DiscordBot:

def __init__(self, email, password):
    self.email = email
    self.password = password
    self.driver = webdriver.Firefox()

def closeBrowser(self):
    self.driver.close()      

def login(self):
    driver = self.driver
    driver.get("https://discordapp.com/login")
    browser = webdriver.Firefox()
    email = browser.find_element("register-email")
    email.send_keys("[email protected]")
    password = browser.find_element("register-password")
    password.send_keys("my password")
    browser.find_element_by_name("login").click()
    time.sleep(2)
However, my problem is when the above code runs, it produces the following error:

raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: 
Message: unknown variant `register-email`, expected one of `css selector`, `link text`,
`partial link text`, `tag name`, `xpath` at line 1 column 26
Reply


Messages In This Thread
Trying to make a bot to connect on discord with Selenium Python - by johnsmith43 - Nov-30-2020, 07:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  connect sql by python using txt. file dawid294 2 512 Jan-12-2024, 08:54 PM
Last Post: deanhystad
  How to Connect to PostgreSQL Through Jump Server and SSH Tunnel using Python? nishans 1 1,168 Jan-02-2024, 10:37 AM
Last Post: khanzain
  python connect to mssql wailoonho 7 1,826 Dec-07-2023, 02:06 AM
Last Post: wailoonho
  Using Python to connect to an XML ? jehoshua 12 2,097 Jul-11-2023, 12:34 AM
Last Post: jehoshua
  Looking for discord bot to make loop ping for address ip tinkode 0 1,854 Jul-26-2021, 03:51 PM
Last Post: tinkode
  Creating Discord Bot: Unused import statement 'import discord EyeballCandy 0 3,590 Feb-02-2020, 10:53 PM
Last Post: EyeballCandy
  How to connect Mysql databse with python and VSCode IDE madhusoodhananER 1 8,791 Oct-31-2019, 10:15 AM
Last Post: Larz60+
  Problem Discord Bot Python Kint 4 90,765 Aug-11-2019, 04:02 PM
Last Post: Kint
  Connect a Teradata DB to Python OscarBoots 10 9,024 Jan-31-2019, 10:23 PM
Last Post: OscarBoots
  Python connect to Sybase IQ FORTITUDE 1 4,836 Jan-24-2019, 02:14 AM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020