i was trying to build a webscraper but i came to the point where i try to select a select-element() but Selenium cant find the object and throws the Exception.
I used find_element with the correct XPATH (100% sure), but it just doesnt work. I tried to find it by its name but i think the XPATH is the only thing that'll work in my case.
Complete code. The problem is the last selection
import data
import time
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get(data.login_site)
username_input = driver.find_element(By.NAME, "_username")
username_input.send_keys(username)
password_input = driver.find_element(By.NAME, "_password")
password_input.send_keys(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()
time.sleep(4)
drpdClass = Select(driver.find_element(By.XPATH, "/html/body/table/tbody/tr/td/form/table/tbody/tr/td[3]/span/nobr/select"))
time.sleep(10)