Articles → Pyautogui → Locatecenteronscreen Function In Pyautogui
Locatecenteronscreen Function In Pyautogui
Purpose
Example
- Save the screen shot of textbox on the local machine
Click to Enlarge
- In the editor, write the following code
import pyautogui
import time
pyautogui.hotkey('win','r')
pyautogui.typewrite("http://gyansangrah.com/ContactUs.aspx")
pyautogui.press('enter')
# Adding delay so that page gets loaded.
time.sleep(5)
pyautogui.click(pyautogui.locateCenterOnScreen("GS_EMAIL.png"))
pyautogui.typewrite("karan@gyansangrah.com")
Output
Click to Enlarge