click with python code example

Example 1: python click on screen

import pyautogui

pyautogui.click(100, 100)
pyautogui.moveTo(100, 150)
pyautogui.moveRel(0, 10)  # move mouse 10 pixels down
pyautogui.dragTo(100, 150)
pyautogui.dragRel(0, 10)  # drag mouse 10 pixels down

Example 2: python move mouse

import mouse
# Number of pixels to move by on x and y axis
x = 1
y = 2
mouse.move(x, y)

Example 3: python button click code

w = Button ( master, option=value, ... )

Example 4: button click event in python

button_element = driver1.find_element_by_id('button event')
        button_element.click()