Questions tagged [pyautogui]

PyAutoGUI is a cross-platform GUI automation Python module used to programmatically control the mouse and keyboard.

Official document.

PyAutoGUI lets your Python scripts control the mouse and keyboard to automate interactions with other applications. The API is designed to be as simple. PyAutoGUI works on Windows, macOS, and Linux, and runs on Python 2 and 3.

PyAutoGUI has several features:

  • Moving the mouse and clicking or typing in the windows of other applications.
  • Sending keystrokes to applications (for example, to fill out forms).
  • Take screenshots, and given an image (for example, of a button or checkbox), find it on the screen.
  • Locate an application’s window, and move, resize, maximize, minimize, or close it (Windows-only, currently) Display message boxes for user interaction while your GUI automation script runs.
1828 questions
5
votes
3 answers

Windows Desktop GUI Automation using Python - Sleep vs tight loop

I am using PyAutoGUI library of Python to automate GUI. The application which I am automating opens a new window after I am done with data entry on my current window. Everything is taken care by python automation (data entry in my current window and…
toddlermenot
  • 1,588
  • 2
  • 17
  • 33
4
votes
1 answer

Is there anything similar to PyAutoGUI for NodeJS that can try to locate an image inside a screen capture?

I am trying to code a bot to automate some tasks on a videogame with JS and Node, so far I've been using RobotJS. The problem I'm facing is that I need to find something on the screen as it moves from time to time to then click on it. Something…
Oscar Arranz
  • 631
  • 2
  • 9
  • 23
4
votes
3 answers

How to install PyQt5 on M1 arm64 architecture?

I have an M1 mac, but I've noticed that whenever native python is running any automation script (like PyAutoGui) it progressively gets slower and slower, almost as if it's being throttled. I created an environment with Miniforge3 that is able to…
4
votes
2 answers

No Module Named 'Symbol'

I have problem with my pip . Lately I was getting error when I was trying to install any packages The Error was: ( Pyautogui ) Traceback (most recent call last): File…
R.A
  • 61
  • 1
  • 5
4
votes
2 answers

AttributeError: module 'pyautogui' has no attribute 'getWindowsWithTitle'

I am writing a bot to interact with the browser (do not persuade me to rewrite for Selenium or Keyboard and others) and it gave me an error. There are no files with the name pyautogui nearby and I tried name it main and python v3.8, 3.9. Received…
VladKochetov
  • 105
  • 2
  • 12
4
votes
3 answers

Can you set a screen size and use pyautogui / selenium chrome driver without a monitor

Does anyone know how to force pyautogui or python in general to recognize a set screen size and take in display data, even if no display is connected? I have a task that uses pyautogui, and selenium chrome driver, which both require a display, or…
AlbinoRhino
  • 467
  • 6
  • 23
4
votes
1 answer

pyautogui issue with Pystray

Having issue with pyautogui and pystray. Using python Version 3.6.4. Simply importing both modules into the same script and calling any pyautogui function produces an error. Is there a fix to this or a work around?? I simply want to use the…
4
votes
2 answers

How to take screenshots faster on macOS?

import pyautogui import time def test_time(): t1 = time.time() for i in range(100): img = pyautogui.screenshot() t2 = time.time() print(t2-t1) test_time() I am trying to make bot, which checks pixels and then clicks at…
user13566332
4
votes
2 answers

Pyautogui not running on Mac? (Catalina)

I'm trying to run the following from terminal on my mac, but what's happening is the code appears to run (I don't get any error message), python (as an app) on my mac bounces on my dock as if to open and then it doesn't do anything and then it stops…
4
votes
1 answer

PyAutoGUI locate on screen function giving error on linux

When running the pyautogui.locateOnScreen() function it gives me the following error: scrot: invalid option -- 'z' Does anyone know why this might be happening? I have scrot 0.8 installed and just running scrot a.png in the terminal works just fine.…
Max
  • 43
  • 3
4
votes
1 answer

Record screen with Python into GIF

This records a 5-second screencast of a 300x300px top-left square of the screen (10 frame per second): import time, numpy as np, pyautogui, imageio t0 = time.time() with imageio.get_writer('test.gif', mode='I', duration=0.1) as writer: while…
Basj
  • 41,386
  • 99
  • 383
  • 673
4
votes
9 answers

Pyautogui not importing "No module named 'pyautogui' "

import pyautogui print("hello") After running this I am presented with the following: C:\Users\Darkm\Anaconda3\envs\PythonChallenges\python.exe C:/Users/Darkm/PycharmProjects/PythonChallenges/Automation1.py Traceback (most recent call last): …
Kevin Shum
  • 43
  • 1
  • 1
  • 3
4
votes
2 answers

Copying highlighted text to clipboard in Python

I'm a Python newbie trying to work out how to have Python copy whatever text I have highlighted when the program is called. I've looked at the solution posted in this thread: Copy highlighted text to clipboard, then use the clipboard to append it to…
4
votes
3 answers

keyDown function not working with shift key

I am trying to hold down the 'shift' key and press the 'down' key using the pyautogui module. But the pyautogui.keyDown() does not function with shift key. The py.keyDown('shift') does not seem to work. Only the py.press('down') is working without…
Cool coder
  • 41
  • 1
  • 3
4
votes
1 answer

Is there a way where one can detect RGB value of a certain pixel and use it in an if condition?

I'm trying to write a script which will automate the boring stuff at work. To do so, I'am using "pyautogui" and most of the script is done. The OS is windows btw. My problem is, I'm currently using time.sleep() commands for the script to work…
SatisG
  • 45
  • 3