1 for i in range(20): # adjust integer value for need
2 # you can change right side number for scroll convenience or destination
3 driver.execute_script("window.scrollBy(0, 250)")
4 # you can change time integer to float or remove
5 time.sleep(1)
6
1from selenium import webdriver
2import time
3
4browser = webdriver.Firefox()
5browser.get("https://en.wikipedia.org")
6browser.execute_script("window.scrollTo(0,document.body.scrollHeight)")
7time.sleep(3)
8browser.close()
1from selenium.webdriver.common.action_chains import ActionChains
2
3element = driver.find_element_by_id("my-id")
4
5actions = ActionChains(driver)
6actions.move_to_element(element).perform()
1while driver.find_element_by_tag_name('div'):
2 driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
3 Divs=driver.find_element_by_tag_name('div').text
4 if 'End of Results' in Divs:
5 print 'end'
6 break
7 else:
8 continue