I am trying to find this item by this text in-between :
I currently have the following code:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
options=Options()
driver=webdriver.Chrome(options=options)
#Directing to site
driver.get("https://www.amazon.co.uk");
#Searching and navigating to search page
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div[1]/span/form/div[3]/span[1]/span/input"))).click()
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div[1]/header/div/div[1]/div[2]/div/form/div[2]/div[1]/input"))).send_keys("Nintendo Switch")
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div[1]/header/div/div[1]/div[2]/div/form/div[3]/div/span/input"))).click()
#Locating item on page
element = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//span[contains(., 'Nintendo Switch (OLED Model)')]"))).click()
however there seems to be a mistake here. What would be the correct way of rewriting this?