← Go Back

How to Take a Screenshot

Using the PyAutoGUI automation module:

import pyautogui

# Take a screenshot.
screenshot = pyautogui.screenshot()
# Save it in the file system.
screenshot.save("screenshot.png")

Make sure to install PyAutoGUI by running:

pip install pyautogui

automation images