Sorunsuz bir şekilde Discord’a giriş yapıp kanalada geliyorum fakat kanala mesaj göndermek istediğimde şu hatayı alıyorum:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[xpath="/html/body/div[1]/div[2]/div/div[1]/div/div[2]/div/div[1]/div/div/div[2]/div[2]/main/form/div[1]/div[1]/div/div[3]/div/div/div/span"]"}
Kod:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from time import sleep
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
driver.get("https://discord.com/login")
sleep(3)
email = driver.find_element(By.XPATH, "/html/body/div[2]/div[2]/div/div[1]/div/div/div/div/form/div/div/div[1]/div[2]/div[1]/div/div[2]/input")
password = driver.find_element(By.XPATH, "/html/body/div[2]/div[2]/div/div[1]/div/div/div/div/form/div/div/div[1]/div[2]/div[2]/div/input")
login = driver.find_element(By.XPATH, "/html/body/div[2]/div[2]/div/div[1]/div/div/div/div/form/div/div/div[1]/div[2]/button[2]")
email.send_keys("mail")
password.send_keys("password")
login.send_keys(Keys.ENTER)
sleep(20)
driver.get("https://discord.com/channels/1031235541993259159/1031235542525956168")
sleep(5)
#Sorunun Bulunduğu Kod
channel = driver.find_element(By.XPATH, "/html/body/div[1]/div[2]/div/div[1]/div/div[2]/div/div[1]/div/div/div[2]/div[2]/main/form/div[1]/div[1]/div/div[3]/div/div/div/span")
channel.send_keys("deneem")
sleep(100)