Selenium - send keys - what element should I use Selenium - send keys - what element should I use selenium selenium

Selenium - send keys - what element should I use


This should be enough to make scroll to page bottom

from selenium import webdriverfrom selenium.webdriver.common.keys import Keysdriver=webdriver.Chrome()driver.get("site_name")driver.find_element_by_xpath('//body').send_keys(Keys.CONTROL+Keys.END)


body = driver.find_element_by_xpath('/html/body')body.click()ActionChains(driver).key_down(Keys.COMMAND).send_keys(Keys.ARROW_DOWN).perform()

Looking at your previous question Link
This works on mac. Change the combo for Windows.


A simple javascript should be sufficient as well. Python syntax

driver.execute_script("window.scrollTo(0,document.body.scrollHeight);")