Ответсообщение недоступно
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# Initialize your WebDriver (e.g., ChromeDriver)
driver = webdriver.Chrome(executable_path='/path/to/chromedriver')
# Navigate to a webpage
driver.get('https://example.com')
# Find the element you want to click (replace with your own selector)
element = driver.find_element_by_css_selector('#my-element')
# Define the desired offset (in pixels)
x_offset = 10 # Horizontal offset
y_offset = 20 # Vertical offset
# Create an ActionChains object
actions = ActionChains(driver)
# Move to the element with the specified offset
actions.move_to_element_with_offset(element, x_offset, y_offset)
# Perform the click action
actions.click().perform()
# Close the browser
driver.quit()