Articles → Pyautogui → Locatecenteronscreen Function In Pyautogui

Locatecenteronscreen Function In Pyautogui






Purpose





Example




  1. Save the screen shot of textbox on the local machine
  2. Picture showing the screen shot of the textbox

    Click to Enlarge

  3. In the editor, write the following code
  4. 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


Picture showing the output of the LocateCenterOnScreen function in pyautogui

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, May 28, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250