'pyautogui -> IndexError: list index out of range - help me
An error occurred and I don't know why. I tried various ways to try, but the error was not resolved. Why am I getting an error?
import clipboard
import pyautogui
import time
# 1stage 가장 위에 존재하는 토렌트의 '위치지정' 누르기
p_list = pyautogui.locateAllOnScreen('test_img_3.png')
p_list = list(p_list)
p_center = pyautogui.center(p_list[0])
pyautogui.moveTo(p_center)
print(p_center)
pyautogui.moveRel(-300, 82, 0.1)
pyautogui.click(button='right')
pyautogui.moveRel(20, 140)
pyautogui.click()
time.sleep(0.1)
# 1 단계 위치지정 누르기 작업 완료 종료
# 2stage
p2_list = pyautogui.locateAllOnScreen('test_img.png')
p2_list = list(p2_list)
p2_center = pyautogui.center(p2_list[0])
pyautogui.moveTo(p2_center)
print(p2_center)
pyautogui.moveRel(-80, 0, 0.1)
pyautogui.click(button='right')
#
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

