Screen Scraping with pyautogui

Опубликовано: 20 Март 2026
на канале: Afterowl
3,914
77

import webbrowser
import time
import pyautogui

webbrowser.open('www.youtube.com')
print('waiting for 6 seconds for youtube to open')
time.sleep(6)

print('clicked search bar')
step1 = pyautogui.locateOnScreen("search bar.png")
pyautogui.click(step1)

print('typing')
pyautogui.typewrite('afterowl python')
time.sleep(3)

print('clicking on search button')
step2 = pyautogui.locateCenterOnScreen("search button.png")
pyautogui.click(step2)
time.sleep(3)

print('clicking on Python Graph image')
step3 = pyautogui.locateCenterOnScreen("python graph.png")
pyautogui.click(step3)