I'm a bit new to Selenium and am trying to build a webscraper that can select a dropdown menu and then select specific options from the menu. I've built the following code and it was working at one point, but now seems to have stopped working. Ideally, I would like to be able to select by years from the dropdown menu.
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from bs4 import BeautifulSoup
import requests
from selenium.webdriver.common.by import By
import pandas as pd
import csv
import sqlite3
import time
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.select import Select
service = Service()
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)
#ministry of defense
url = 'https://www.homeaffairs.gov.au/news-media/archive#'
driver.get(url)
#parse html using beautiful soup
res = requests.get(url)
soup = BeautifulSoup(res.text, 'html.parser')
a = WebDriverWait(driver, 30).until(EC.visibility_of_all_elements_located((By.XPATH, '/html/body/form/div[3]/div[2]/div[2]/div[3]/main/div/div[5]/div[3]/div/div[2]/div[3]/div[2]/div/div/div[1]/ha-news-archive/div/ha-news-filters/div/div/div/div/div/div[1]/div/select')))
select = Select(driver.find_element(By.XPATH, '/html/body/form/div[3]/div[2]/div[2]/div[3]/main/div/div[5]/div[3]/div/div[2]/div[3]/div[2]/div/div/div[1]/ha-news-archive/div/ha-news-filters/div/div/div/div/div/div[1]/div/select'))
#select by visible text
select.select_by_visible_text('2024')
As you can see, I have tried to use the WebDriverWait function in case there are some issues with the page loading and the element not being yet visible, but I still receive the following error, which leads me to believe that I am not able to locate the element for the 2024 year option:
--> 137 raise NoSuchElementException(f"Could not locate element with visible text: {text}")
NoSuchElementException: Message: Could not locate element with visible text: 2024; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
I've also tried to select by values of the dropdown menu, tried other years as well, and no luck. I'm not sure why this code would have stopped working all of a sudden, but would really appreciate any insights.

'form_control.ng-valid.ng-dirty.ng-touched'