I want to select a list of items using a CSS selector. However, when I try to retrieve the elements on the page, I am only getting three items, even though there should be 50 items. After inspecting the page structure, I can confirm that it should contain all 50 elements. Nevertheless, I am still getting a list with only three elements. Is there something wrong with my code or css syntax?
product_names must be an iterable object with 50 items
product_names = driver.find_elements(By.CSS_SELECTOR, ".elements-title-normal")
time.sleep(1)
list1 = []
for i in product_names:
list1.append(i.find_element(By.CSS_SELECTOR, ".elements-title-normal.one-line").text())
time.sleep(1)
print(list1)
I got 3 items from "product_names"