I should use this:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import Select
with open("sel_path.txt") as path:
s = path.read()
serv = Service(s)
driver = webdriver.Chrome(service=serv)
driver.get("https://pynishant.github.io/dropdown-selenium-python-select.html")
lang = driver.find_element(By.ID, "lang1")
select = Select(lang)
select.select_by_value("1")
But I get this error:
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable: Element is not currently visible and may not be manipulated
I think its not working since the elements show up after the usr clicks the box but I have no idea how to get around that to select the element with Selenium
Ultimately I am trying to target this box.
I don't know if its because of the old Selenium syntax getting deprecated or not...
Any help would be greatly appreciated.