0

I am trying to scroll through a list of links that get outputted after selecting a filter. But when i try to execute the script to scroll, it does nothing.

driver = web.Chrome('/Users/JakesComp/Documents/chromedriver')
driver.get("https://foodmarketmaker.com/main/mmsearch")
iframe = driver.find_element_by_tag_name("iframe")
driver.switch_to.frame(iframe)

wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//section[@id="search-right"]//input[@placeholder="start typing to search"]'))).click()
wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//li[@aria-label="Business Type: Farmer/Rancher"]'))).click()
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
links = wait(driver, 10).until(EC.presence_of_all_elements_located((By.XPATH, '//section[@id="search-results"]//a[.//*[name()="svg"]]')))

for link in links:
    print(link.get_attribute('href'))
2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.