While i coded my Discord Bot and tried to run it on repl.it i always get this error but idk why. On my computer in PyCharm it works fine
import data
import asyncio
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
import discord
import time
from keepalive import keep_alive
intents = discord.Intents.default()
intents.message_content = True
bot = discord.Client(intents=intents)
async def checktime():
while True:
current_time = time.localtime()
formattedtime = time.asctime(current_time)
finaltime = formattedtime[11:16]
if finaltime == '19:30':
await getsubstitutions()
await asyncio.sleep(60)
async def getsubstitutions():
op = webdriver.ChromeOptions()
op.add_argument('--headless')
driver = webdriver.Chrome(options=op)
driver.get(data.login_site)
username_input = driver.find_element(By.NAME, "_username")
username_input.send_keys(data._username)
password_input = driver.find_element(By.NAME, "_password")
password_input.send_keys(data._password)
login_button = driver.find_element(By.XPATH,
"//button[@class='btn btn-primary']")
login_button.click()
plaene_button = driver.find_element(By.XPATH,
"//a[@href='/iserv/plan/overview']")
plaene_button.click()
plaene_show = driver.find_element(
By.XPATH, "//a[@href='/iserv/plan/show/Plan%20Schueler']")
plaene_show.click()
iframe = driver.find_element(
By.CSS_SELECTOR,
"#content > div > div > div > div > div.panel-body > div > iframe")
driver.switch_to.frame(iframe)
driver.switch_to.frame(1)
drpdClass = Select(
driver.find_element(
By.CSS_SELECTOR,
"body > table > tbody > tr > td > form > table > tbody > tr > td:nth-child(3) > span > nobr > select"
))
drpdClass.select_by_value("20")
driver.switch_to.default_content()
driver.switch_to.frame(iframe)
driver.switch_to.frame(2)
substitutions = driver.find_element(By.CSS_SELECTOR, "#vertretung")
substitution = substitutions.text
driver.quit()
channel = bot.get_channel(1139298506067161302)
await channel.send(substitution)
@bot.event
async def on_ready():
print(f'We have logged in as {bot.user}')
await checktime()
keep_alive()
bot.run(
'MTEzOTI5Njc5NjU4MjA4ODc3NA.GXDbvy.SGM9SP0jJJHf2sRqTVGEj871NSO4u-c_lgqFOU')
Thats the code. It should basically send the substitutions for my school into a channel everyday at a certain time. But every time i get the following "error", its not really an error but its blocking the code to be executed. Heres the "Error