2022年2月22日 星期二

Selenium Page down by ActionChains

I had to click on the body for the Keys.PAGE_DOWN to work but didn't need to use the action chain:

from selenium.webdriver.common.keys import Keys

body = driver.find_element_by_css_selector('body')
body.click() 

body.send_keys(Keys.PAGE_DOWN) 


from: https://stackoverflow.com/questions/39471163/selenium-page-down-by-actionchains/39472743

Send Keys shift+tab on Selenium Web driver

 Shamelessly copied from https://www.programcreek.com/python/example/97717/selenium.webdriver.common.keys.Keys.SHIFT

a = ActionChains(driver)
a.key_down(Keys.SHIFT).send_keys(Keys.TAB).key_up(Keys.SHIFT)
a.perform()


from: https://stackoverflow.com/questions/56691117/send-keys-shifttab-on-selenium-web-driver