You can simply use CTRL
+ HOME
keys. It will scroll to the top of the page.
from selenium.webdriver.common.keys import Keys
driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL + Keys.HOME)
More Related Contents:
- An error has occured in ‘site url’: Uncaught TypeError: Cannot read property ‘getColomnSet’ of undefined with Selenium and Python
- org.openqa.selenium.ElementNotInteractableException: Element is not reachable by keyboard: while sending text to FirstName field in Facebook
- WebDriver click() vs JavaScript click()
- Execute JavaScript using Selenium WebDriver in C#
- Getting the return value of Javascript code in Selenium
- ElementClickInterceptedException: Message: element click intercepted Element is not clickable error clicking a radio button using Selenium and Python
- Understanding execute async script in Selenium
- What does arguments[0] and arguments[1] mean when using executeScript method from JavascriptExecutor interface through Selenium WebDriver?
- Accessing elements in the shadow DOM
- What is JavaScriptExecutor in Selenium?
- Disable images in Selenium Python
- Ways to deal with #document under iframe
- Can a website detect when you are using Selenium with chromedriver?
- How to get attribute of element from Selenium?
- find_element_by_* commands are deprecated in selenium
- Don’t wait for a page to load using Selenium in Python
- Element not visible error (not able to click an element)
- How to rotate Selenium webrowser IP address
- How do you fix the “element not interactable” exception?
- How to open multiple webpages in separate tabs within a browser using selenium-webdriver and python
- Selenium Datepicker using JavascriptExecutor
- “NoSuchWindowException: no such window: window was already closed” while switching tabs using Selenium and WebDriver through Python3
- Take elements while a condition evaluates to true (extending ElementArrayFinder)
- How to test non-standard drop down lists through a crawler using Selenium and Python
- Python selenium: wait until element is clickable – not working
- How to select multiple options from multi select list using Selenium-Python?
- Opening a new tab using Ctrl + click combination in Selenium Webdriver
- Python Selenium driver.execute_script WebDriverException: Message: unknown error: call function result missing ‘value’
- What is unittest in selenium Python?
- selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service chromedriver.exe while opening chrome browser