Move mouse cursor to element in browser
Project description
SeleniumMoveCursor
Moving cursor to element in browser run by selenium webdriver. Currently works for chrome browser, maximized. Method to use is move_to_element_chrome.
#Preconditions
- Chrome is run by selenium webdriver and is maximized
- Chrome infobar is disabled. Python code to achieve this:
from selenium import webdriver
chrome_options = webdriver.ChromeOptions() chrome_options.add_argument("--disable-infobars") driver = webdriver.Chrome(chrome_options=chrome_options)
- Web element is visible on browser (scroll is done before calling method move_to_element_chrome)
- Display scaling (100, 125, 150 or 175 %) need to be given when calling method move_to_element_chrome. This info can be found in display settings.
#How to use method for moving cursor to web element (move_to_element_chrome):
from selenium import webdriver from selenium_move_cursor.MouseActions import move_to_element_chrome
chrome_options = webdriver.ChromeOptions() chrome_options.add_argument("--disable-infobars") driver = webdriver.Chrome(chrome_options=chrome_options)
driver.maximize_window()
driver.get("https://www.google.com/") element = driver.find_elements_by_css_selector("input[class='gNO89b']")[1]
move_to_element_chrome(driver, element, 125)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for selenium-move-cursor-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20ff642f5a6c47650606763c56ba1c5792a0d7423be68031f2c231f892481bd3 |
|
MD5 | cea13d40a37a9474a4b9c316505c72c9 |
|
BLAKE2b-256 | c15aab2b87939292305adc28d1058a275888e9a0f7928d080bbe11ead8d9024d |
Hashes for selenium_move_cursor-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db0b52a11c77770f624ab1229c85ae6894d5da7320bc7c3045991148eb6f256a |
|
MD5 | a97706a42cdc4f0b89ef6cc6aab9014b |
|
BLAKE2b-256 | 27ebe61103c6b31d241e267aafe1dc57598863ade40208bcaeec175b7c935a50 |