我正试图从网页上废弃数据。但问题是,当我使用下面的代码,它不过滤的结果。该页面显示了120个项目。但是在send_key和click()之后,它应该返回73个项目,然后我应该检索这73个数据。有人知道怎么解决这个问题吗?TIA
driver.find_element(by=By.XPATH, value='//*[@id="locationSearch"]').send_keys('Ontario, CA')
time.sleep(5)
driver.find_element(by=By.XPATH, value='/html/body/div/div/div[3]/div/div[3]/div[2]/div/div[2]/div/div[2]/div[1]/div/ul/li[1]').click()
time.sleep(5)
driver.find_element(by=By.XPATH, value='//*[@id="app"]/div[3]/div/div[3]/div[2]/div/div[2]/div/div[2]/div[2]/button').click()
time.sleep(5)
getListingUrls = driver.find_elements(
by=By.XPATH, value='//*[@id="catalog-listing"]/article/div/div[1]/div[2]/div/div/div/div[1]/div[1]/div[2]/h2/a')
import undetected_chromedriver as uc
driver = uc.Chrome()
谢谢@furas https://stackoverflow.com/users/1832058/furas