Я ожидаю, что приведенный ниже скрипт напечатает несколько названий машин
Я думаю, что неправильно указываю на карусель.
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import time
driver = webdriver.Chrome(executable_path=r"../Downloads/chromedriver.exe")
driver.get('https://www.nationwidevehiclecontracts.co.uk/?msclkid=22db17e69fc512c5ab9f49993f841304&utm_source=bing&utm_medium=cpc&utm_campaign=B%20-%20NVC%20Brand%20-%20(Exact)&utm_term=nationwide%20car%20leasing&utm_content=Brand%20Variations')
carousel_x_path="/section[@class='section section--widget section--full-carousel section__heading-scroll variant-display']"
WebDriverWait(driver,30).until(EC.visibility_of_element_located((By.XPATH,carousel_x_path)));
for name in (driver.find_elements_by_xpath(carousel_x_path+"/span[@class='make']")):
print("it found a name")
print(name.get_attribute("textContent"))
Я получаю эту ошибку.
Traceback (most recent call last):
File "C:\Users\User\Desktop\miniiiiii.py", line 10, in <module>
WebDriverWait(driver,30).until(EC.visibility_of_element_located((By.XPATH,carousel_x_path)));
File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
подскажите, пожалуйста, что не так