Вызвать WebDriverWait
() и дождаться visibility_of_all_elements_located
() и ниже xpath.
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
driver=webdriver.Chrome("Path to Chromedriver")
driver.get("https://www.grailed.com/designers/jordan-brand/hi-top-sneakers")
elements=WebDriverWait(driver,10).until(EC.visibility_of_all_elements_located((By.XPATH,"//div[@class='feed-item']//div[@class='listing-designer-and-size']/p[@class='listing-designer truncate']")))
itemlist=[item.text for item in elements ]
print(itemlist)
Вывод :
['JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND × NIKE', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND × NIKE', 'JORDAN BRAND', 'JORDAN BRAND × NIKE', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND × NIKE', 'JORDAN BRAND × NIKE', 'JORDAN BRAND', 'JORDAN BRAND × NIKE', 'JORDAN BRAND × NIKE', 'JORDAN BRAND', 'JORDAN BRAND × NIKE', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND × NIKE', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND × NIKE', 'JORDAN BRAND × NIKE', 'JORDAN BRAND', 'JORDAN BRAND', 'JORDAN BRAND × NIKE × VINTAGE', 'JORDAN BRAND', 'JORDAN BRAND']