Best Python code snippet using ATX
pyautogui_demo.py
Source:pyautogui_demo.py
1import pyautogui2import time3pyautogui.PAUSE = 1 # è°ç¨å¨æ§è¡å¨ä½åæåçç§æ°ï¼åªè½å¨æ§è¡ä¸äºpyautoguiå¨ä½åæè½ä½¿ç¨ï¼å»ºè®®ç¨time.sleep4pyautogui.FAILSAFE = True # å¯ç¨èªå¨é²æ
éåè½ï¼å·¦ä¸è§çåæ 为ï¼0ï¼0ï¼ï¼å°é¼ æ 移å°å±å¹çå·¦ä¸è§ï¼æ¥æåºfailSafeExceptionå¼å¸¸5def test():6 # å¤æ(x,y)æ¯å¦å¨å±å¹ä¸7 x, y = 122, 2448 pyautogui.onScreen(x, y) # ç»æ为true9 width, height = pyautogui.size() # å±å¹ç宽度åé«åº¦10 print(width, height)11# é¼ æ æ§å¶12def mouse_control():13 currentMouseX, currentMouseY = pyautogui.position() # é¼ æ å½åä½ç½®14 print(currentMouseX, currentMouseY)15 # æ§å¶é¼ æ 移å¨,duration为æç»æ¶é´16 for i in range(2):17 pyautogui.moveTo(100, 100, duration=0.25) # 移å¨å° (100,100)18 pyautogui.moveTo(200, 100, duration=0.25)19 pyautogui.moveTo(200, 200, duration=0.25)20 pyautogui.moveTo(100, 200, duration=0.25)21 for i in range(2):22 pyautogui.moveRel(50, 0, duration=0.25) # ä»å½åä½ç½®å³ç§»100åç´ 23 pyautogui.moveRel(0, 50, duration=0.25) # åä¸24 pyautogui.moveRel(-50, 0, duration=0.25) # åå·¦25 pyautogui.moveRel(0, -50, duration=0.25) # åä¸26 # æä½é¼ æ å·¦é®ï¼æé¼ æ ææ½å°(100, 200)ä½ç½®27 pyautogui.dragTo(100, 200, button='left')28 # æä½é¼ æ å·¦é®ï¼ç¨2ç§éæé¼ æ ææ½å°(300, 400)ä½ç½®29 pyautogui.dragTo(300, 400, 2, button='left')30 # æä½é¼ æ å·¦é®ï¼ç¨0.2ç§éæé¼ æ åä¸ææ½31 pyautogui.dragRel(0, -60, duration=0.2)32 # pyautogui.click(x=moveToX, y=moveToY, clicks=num_of_clicks, interval=secs_between_clicks, button='left')33 # å
¶ä¸ï¼buttonå±æ§å¯ä»¥è®¾ç½®æleftï¼middleårightã34 pyautogui.click(10, 20, 2, 0.25, button='left')35 pyautogui.click(x=100, y=200, duration=2) # å
移å¨å°(100, 200)ååå»36 pyautogui.click() # é¼ æ å½åä½ç½®ç¹å»ä¸ä¸37 pyautogui.doubleClick() # é¼ æ å½åä½ç½®å·¦å»ä¸¤ä¸38 pyautogui.doubleClick(x=100, y=150, button="left") # é¼ æ å¨ï¼100ï¼150ï¼ä½ç½®å·¦å»ä¸¤ä¸39 pyautogui.tripleClick() # é¼ æ å½åä½ç½®å·¦å»ä¸ä¸40 pyautogui.mouseDown() # é¼ æ å·¦é®æä¸åæ¾å¼41 pyautogui.mouseUp()42 pyautogui.mouseDown(button='right') # æä¸é¼ æ å³é®43 pyautogui.mouseUp(button='right', x=100, y=200) # 移å¨å°(100, 200)ä½ç½®ï¼ç¶åæ¾å¼é¼ æ å³é®44 # scrollå½æ°æ§å¶é¼ æ æ»è½®çæ»å¨ï¼amount_to_scrollåæ°è¡¨ç¤ºæ»å¨çæ ¼æ°ãæ£æ°å页é¢åä¸æ»å¨ï¼è´æ°ååä¸æ»å¨45 # pyautogui.scroll(clicks=amount_to_scroll, x=moveToX, y=moveToY)46 pyautogui.scroll(5, 20, 2)47 pyautogui.scroll(10) # åä¸æ»å¨10æ ¼48 pyautogui.scroll(-10) # åä¸æ»å¨10æ ¼49 pyautogui.scroll(10, x=100, y=100) # 移å¨å°(100, 100)ä½ç½®ååä¸æ»å¨10æ ¼50 # ç¼å¨/æ¸åå½æ°å¯ä»¥æ¹åå
æ 移å¨è¿ç¨çé度åæ¹åãéå¸¸é¼ æ æ¯åéç´çº¿è¿å¨ï¼è¿å°±æ¯çº¿æ§ç¼å¨/æ¸åå½æ°ã51 # PyAutoGUIæ30ç§ç¼å¨/æ¸åå½æ°ï¼å¯ä»¥éè¿pyautogui.ease*?æ¥çã52 # å¼å§å¾æ
¢ï¼ä¸æå é53 pyautogui.moveTo(100, 100, 2, pyautogui.easeInQuad)54 # å¼å§å¾å¿«ï¼ä¸æåé55 pyautogui.moveTo(100, 100, 2, pyautogui.easeOutQuad)56 # å¼å§åç»æé½å¿«ï¼ä¸é´æ¯è¾æ
¢57 pyautogui.moveTo(100, 100, 2, pyautogui.easeInOutQuad)58 # ä¸æ¥ä¸å¾å¾åè¿59 pyautogui.moveTo(100, 100, 2, pyautogui.easeInBounce)60 # å¾å¾å¹
度æ´å¤§ï¼çè³è¶
è¿èµ·ç¹åç»ç¹61 pyautogui.moveTo(100, 100, 2, pyautogui.easeInElastic)62# è·åé¼ æ ä½ç½®63def get_mouse_positon():64 time.sleep(5) # åå¤æ¶é´65 print('å¼å§è·åé¼ æ ä½ç½®')66 try:67 for i in range(10):68 # Get and print the mouse coordinates.69 x, y = pyautogui.position()70 positionStr = 'é¼ æ åæ ç¹ï¼X,Yï¼ä¸ºï¼{},{}'.format(str(x).rjust(4), str(y).rjust(4))71 pix = pyautogui.screenshot().getpixel((x, y)) # è·åé¼ æ æå¨å±å¹ç¹çRGBé¢è²72 positionStr += ' RGB:(' + str(pix[0]).rjust(3) + ',' + str(pix[1]).rjust(3) + ',' + str(pix[2]).rjust(73 3) + ')'74 print(positionStr)75 time.sleep(0.5) # åé¡¿æ¶é´76 except:77 print('è·åé¼ æ ä½ç½®å¤±è´¥')78# é®çæ§å¶79def key_board_control():80 pyautogui.typewrite('Hello world!') # è¾å
¥Hello world!å符串81 pyautogui.typewrite('Hello world!', interval=0.25) # æ¯æ¬¡è¾å
¥é´é0.25ç§ï¼è¾å
¥Hello world!82 pyautogui.press('enter') # æä¸å¹¶æ¾å¼ï¼è½»æ²ï¼å车é®83 pyautogui.press(['left', 'left', 'left', 'left']) # æä¸å¹¶æ¾å¼ï¼è½»æ²ï¼åä¸å·¦æ¹åé®84 pyautogui.keyDown('shift') # æä¸`shift`é®85 pyautogui.keyUp('shift') # æ¾å¼`shift`é®86 pyautogui.keyDown('shift')87 pyautogui.press('4')88 pyautogui.keyUp('shift') # è¾åº $ 符å·çæé®89 pyautogui.hotkey('ctrl', 'v') # ç»åæé®ï¼Ctrl+Vï¼ï¼ç²è´´åè½ï¼æä¸å¹¶æ¾å¼'ctrl'å'v'æé®90 # pyautogui.KEYBOARD_KEYSæ°ç»ä¸å°±æ¯press()ï¼keyDown()ï¼keyUp()åhotkey()å½æ°å¯ä»¥è¾å
¥çæé®å称91 pyautogui.KEYBOARD_KEYS = ['\t', '\n', '\r', ' ', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-',92 '.',93 '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@',94 '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',95 'l',96 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~',97 'accept', 'add', 'alt', 'altleft', 'altright', 'apps', 'backspace', 'browserback',98 'browserfavorites', 'browserforward', 'browserhome', 'browserrefresh', 'browsersearch',99 'browserstop', 'capslock', 'clear', 'convert', 'ctrl', 'ctrlleft', 'ctrlright',100 'decimal',101 'del', 'delete', 'divide', 'down', 'end', 'enter', 'esc', 'escape', 'execute', 'f1',102 'f10',103 'f11', 'f12', 'f13', 'f14', 'f15', 'f16', 'f17', 'f18', 'f19', 'f2', 'f20', 'f21', 'f22',104 'f23', 'f24', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'final', 'fn', 'hanguel',105 'hangul',106 'hanja', 'help', 'home', 'insert', 'junja', 'kana', 'kanji', 'launchapp1', 'launchapp2',107 'launchmail', 'launchmediaselect', 'left', 'modechange', 'multiply', 'nexttrack',108 'nonconvert', 'num0', 'num1', 'num2', 'num3', 'num4', 'num5', 'num6', 'num7', 'num8',109 'num9',110 'numlock', 'pagedown', 'pageup', 'pause', 'pgdn', 'pgup', 'playpause', 'prevtrack',111 'print',112 'printscreen', 'prntscrn', 'prtsc', 'prtscr', 'return', 'right', 'scrolllock', 'select',113 'separator', 'shift', 'shiftleft', 'shiftright', 'sleep', 'space', 'stop', 'subtract',114 'tab',115 'up', 'volumedown', 'volumemute', 'volumeup', 'win', 'winleft', 'winright', 'yen',116 'command',117 'option', 'optionleft', 'optionright']118def popups_control():119 # æ¾ç¤ºä¸ä¸ªç®åç带æååOKæé®çæ¶æ¯å¼¹çªãç¨æ·ç¹å»åè¿åbuttonçæåã120 pyautogui.alert(text='', title='', button='OK')121 b = pyautogui.alert(text='è¦å¼å§ç¨åºä¹ï¼', title='请æ±æ¡', button='OK')122 print(b) # è¾åºç»æ为OK123 # æ¾ç¤ºä¸ä¸ªç®åç带æåãOKåCancelæé®çæ¶æ¯å¼¹çªï¼ç¨æ·ç¹å»åè¿å被ç¹å»buttonçæåï¼æ¯æèªå®ä¹æ°åãæåçå表ã124 pyautogui.confirm(text='', title='', buttons=['OK', 'Cancel']) # OKåCancelæé®çæ¶æ¯å¼¹çª125 pyautogui.confirm(text='', title='', buttons=range(10)) # 10个æé®0-9çæ¶æ¯å¼¹çª126 a = pyautogui.confirm(text='', title='', buttons=range(10))127 print(a) # è¾åºç»æä¸ºä½ éçæ°å128 # å¯ä»¥è¾å
¥çæ¶æ¯å¼¹çªï¼å¸¦OKåCancelæé®ãç¨æ·ç¹å»OKæé®è¿åè¾å
¥çæåï¼ç¹å»Cancelæé®è¿åNoneã129 pyautogui.prompt(text='', title='', default='')130 # æ ·å¼åprompt()ï¼ç¨äºè¾å
¥å¯ç ï¼æ¶æ¯ç¨*表示ã带OKåCancelæé®ãç¨æ·ç¹å»OKæé®è¿åè¾å
¥çæåï¼ç¹å»Cancelæé®è¿åNoneã131 pyautogui.password(text='', title='', default='', mask='*')132def screen_control():133 pyautogui.screenshot(r'C:\Users\ZDH\Desktop\PY\my_screenshot.png') # æªå
¨å±å¹¶è®¾ç½®ä¿åå¾ççä½ç½®åå称134 im = pyautogui.screenshot(r'C:\Users\ZDH\Desktop\PY\my_screenshot.png') # æªå
¨å±å¹¶è®¾ç½®ä¿åå¾ççä½ç½®åå称135 print(im) # æå°å¾ççå±æ§136 # ä¸æªå
¨å±ï¼æªååºåå¾çãæªååºåregionåæ°ä¸ºï¼å·¦ä¸è§XYåæ å¼ã宽度åé«åº¦137 pyautogui.screenshot(r'C:\Users\ZDH\Desktop\PY\region_screenshot.png', region=(0, 0, 300, 400))138 pix = pyautogui.screenshot().getpixel((220, 200)) # è·ååæ (220,200)æå¨å±å¹ç¹çRGBé¢è²139 positionStr = ' RGB:(' + str(pix[0]).rjust(3) + ',' + str(pix[1]).rjust(3) + ',' + str(pix[2]).rjust(3) + ')'140 print(positionStr) # æå°ç»æ为RGB:( 60, 63, 65)141 pix = pyautogui.pixel(220, 200) # è·ååæ (220,200)æå¨å±å¹ç¹çRGBé¢è²ä¸ä¸é¢ä¸è¡ä»£ç ä½ç¨ä¸æ ·142 positionStr = ' RGB:(' + str(pix[0]).rjust(3) + ',' + str(pix[1]).rjust(3) + ',' + str(pix[2]).rjust(3) + ')'143 print(positionStr) # æå°ç»æ为RGB:( 60, 63, 65)144 # å¦æä½ åªæ¯è¦æ£éªä¸ä¸æå®ä½ç½®çåç´ å¼ï¼å¯ä»¥ç¨pixelMatchesColor(x,y,RGB)å½æ°ï¼æXãYåRGBå
ç»å¼ç©¿å
¥å³å¯145 # å¦ææå¨å±å¹ä¸(x,y)ç¹çå®é
RGBä¸è²ä¸å½æ°ä¸çRGBä¸æ ·å°±ä¼è¿åTrueï¼å¦åè¿åFalse146 # toleranceåæ°å¯ä»¥æå®çº¢ã绿ãè3ç§é¢è²è¯¯å·®èå´147 pyautogui.pixelMatchesColor(100, 200, (255, 255, 255))148 pyautogui.pixelMatchesColor(100, 200, (255, 255, 245), tolerance=10)149 # è·å¾æ件å¾çå¨ç°å¨çå±å¹ä¸é¢çåæ ï¼è¿åçæ¯ä¸ä¸ªå
ç»(top, left, width, height)150 # å¦ææªå¾æ²¡æ¾å°ï¼pyautogui.locateOnScreen()å½æ°è¿åNone151 a = pyautogui.locateOnScreen(r'C:\Users\ZDH\Desktop\PY\region_screenshot.png')152 print(a) # æå°ç»æ为Box(left=0, top=0, width=300, height=400)153 x, y = pyautogui.center(a) # è·å¾æ件å¾çå¨ç°å¨çå±å¹ä¸é¢çä¸å¿åæ 154 print(x, y) # æå°ç»æ为150 200155 x, y = pyautogui.locateCenterOnScreen(r'C:\Users\ZDH\Desktop\PY\region_screenshot.png') # è¿æ¥ä¸ä¸é¢çåè¡ä»£ç ä½ç¨ä¸æ ·156 print(x, y) # æå°ç»æ为150 200157 # å¹é
å±å¹ææä¸ç®æ å¾çç对象ï¼å¯ä»¥ç¨for循ç¯ålist()è¾åº158 pyautogui.locateAllOnScreen(r'C:\Users\ZDH\Desktop\PY\region_screenshot.png')159 for pos in pyautogui.locateAllOnScreen(r'C:\Users\ZDH\Desktop\PY\region_screenshot.png'):160 print(pos)161 # æå°ç»æ为Box(left=0, top=0, width=300, height=400)162 a = list(pyautogui.locateAllOnScreen(r'C:\Users\ZDH\Desktop\PY\region_screenshot.png'))163 print(a) # æå°ç»æ为[Box(left=0, top=0, width=300, height=400)]164if __name__ == "__main__":...
fimage.py
Source:fimage.py
1# import pyautogui2# import cv23# import numpy4# sys_manger = 'photos/xitongguanli.png'5# print(pyautogui.locateCenterOnScreen(sys_manger))6# Privacy_location = auto.locateCenterOnScreen('D://AppsUITest//Pages//111.jpg',grayscale=False) # ä¼ å
¥æé®çå¾ç7# print(Privacy_location) # è¿åå±å¹æå¨ä½ç½®8#9# im2 = pyautogui.screenshot('my_screenshot.png')10import pyautogui11import time12time.sleep(10)13pyautogui.screenshot(r'D:\workspace\common\photos\my_screenshot.png') # æªå
¨å±å¹¶è®¾ç½®ä¿åå¾ççä½ç½®åå称14im = pyautogui.screenshot(r'D:\workspace\common\photos\my_screenshot.png') # æªå
¨å±å¹¶è®¾ç½®ä¿åå¾ççä½ç½®åå称15print(im) # æå°å¾ççå±æ§16# ä¸æªå
¨å±ï¼æªååºåå¾çãæªååºåregionåæ°ä¸ºï¼å·¦ä¸è§XYåæ å¼ã宽度åé«åº¦17pyautogui.screenshot(r'D:\workspace\common\photos\region_screenshot.png', region=(0, 0, 300, 400))18pix = pyautogui.screenshot().getpixel((220, 200)) # è·ååæ (220,200)æå¨å±å¹ç¹çRGBé¢è²19positionStr = ' RGB:(' + str(pix[0]).rjust(3) + ',' + str(pix[1]).rjust(3) + ',' + str(pix[2]).rjust(3) + ')'20print(positionStr) # æå°ç»æ为RGB:( 60, 63, 65)21pix = pyautogui.pixel(220, 200) # è·ååæ (220,200)æå¨å±å¹ç¹çRGBé¢è²ä¸ä¸é¢ä¸è¡ä»£ç ä½ç¨ä¸æ ·22positionStr = ' RGB:(' + str(pix[0]).rjust(3) + ',' + str(pix[1]).rjust(3) + ',' + str(pix[2]).rjust(3) + ')'23print(positionStr) # æå°ç»æ为RGB:( 60, 63, 65)24# å¦æä½ åªæ¯è¦æ£éªä¸ä¸æå®ä½ç½®çåç´ å¼ï¼å¯ä»¥ç¨pixelMatchesColor(x,y,RGB)å½æ°ï¼æXãYåRGBå
ç»å¼ç©¿å
¥å³å¯25# å¦ææå¨å±å¹ä¸(x,y)ç¹çå®é
RGBä¸è²ä¸å½æ°ä¸çRGBä¸æ ·å°±ä¼è¿åTrueï¼å¦åè¿åFalse26# toleranceåæ°å¯ä»¥æå®çº¢ã绿ãè3ç§é¢è²è¯¯å·®èå´27pyautogui.pixelMatchesColor(100, 200, (255, 255, 255))28pyautogui.pixelMatchesColor(100, 200, (255, 255, 245), tolerance=10)29# è·å¾æ件å¾çå¨ç°å¨çå±å¹ä¸é¢çåæ ï¼è¿åçæ¯ä¸ä¸ªå
ç»(top, left, width, height)30# å¦ææªå¾æ²¡æ¾å°ï¼pyautogui.locateOnScreen()å½æ°è¿åNone31a = pyautogui.locateOnScreen(r'D:\workspace\common\photos\region_screenshot.png')32print(a) # æå°ç»æ为Box(left=0, top=0, width=300, height=400)33x, y = pyautogui.center(a) # è·å¾æ件å¾çå¨ç°å¨çå±å¹ä¸é¢çä¸å¿åæ 34print(x, y) # æå°ç»æ为150 20035x, y = pyautogui.locateCenterOnScreen(r'D:\workspace\common\photos\region_screenshot.png') # è¿æ¥ä¸ä¸é¢çåè¡ä»£ç ä½ç¨ä¸æ ·36print(x, y) # æå°ç»æ为150 20037# å¹é
å±å¹ææä¸ç®æ å¾çç对象ï¼å¯ä»¥ç¨for循ç¯ålist()è¾åº38pyautogui.locateAllOnScreen(r'D:\workspace\common\photos\region_screenshot.png')39for pos in pyautogui.locateAllOnScreen(r'D:\workspace\common\photos\region_screenshot.png'):40 print(pos)41# æå°ç»æ为Box(left=0, top=0, width=300, height=400)42a = list(pyautogui.locateAllOnScreen(r'D:\workspace\common\photos\region_screenshot.png'))...
pyauto.py
Source:pyauto.py
1import pyautogui2import time,datetime3pyautogui.screenshot(r'C:\my_screenshot.png') # æªå
¨å±å¹¶è®¾ç½®ä¿åå¾ççä½ç½®åå称4im = pyautogui.screenshot(r'C:\my_screenshot.png') # æªå
¨å±å¹¶è®¾ç½®ä¿åå¾ççä½ç½®åå称5print(im) # æå°å¾ççå±æ§6# ä¸æªå
¨å±ï¼æªååºåå¾çãæªååºåregionåæ°ä¸ºï¼å·¦ä¸è§XYåæ å¼ã宽度åé«åº¦7pyautogui.screenshot(r'C:\region_screenshot.png', region=(0, 0, 300, 300))8pix = pyautogui.screenshot().getpixel((220, 200)) # è·ååæ (220,200)æå¨å±å¹ç¹çRGBé¢è²9positionStr = ' RGB:(' + str(pix[0]).rjust(3) + ',' + str(pix[1]).rjust(3) + ',' + str(pix[2]).rjust(3) + ')'10print(positionStr) # æå°ç»æ为RGB:( 60, 63, 65)11pix = pyautogui.pixel(220, 200) # è·ååæ (220,200)æå¨å±å¹ç¹çRGBé¢è²ä¸ä¸é¢ä¸è¡ä»£ç ä½ç¨ä¸æ ·12positionStr = ' RGB:(' + str(pix[0]).rjust(3) + ',' + str(pix[1]).rjust(3) + ',' + str(pix[2]).rjust(3) + ')'13print(positionStr) # æå°ç»æ为RGB:( 60, 63, 65)14# å¦æä½ åªæ¯è¦æ£éªä¸ä¸æå®ä½ç½®çåç´ å¼ï¼å¯ä»¥ç¨pixelMatchesColor(x,y,RGB)å½æ°ï¼æXãYåRGBå
ç»å¼ç©¿å
¥å³å¯15# å¦ææå¨å±å¹ä¸(x,y)ç¹çå®é
RGBä¸è²ä¸å½æ°ä¸çRGBä¸æ ·å°±ä¼è¿åTrueï¼å¦åè¿åFalse16# toleranceåæ°å¯ä»¥æå®çº¢ã绿ãè3ç§é¢è²è¯¯å·®èå´17pyautogui.pixelMatchesColor(100, 200, (255, 255, 255))18pyautogui.pixelMatchesColor(100, 200, (255, 255, 245), tolerance=10)19# è·å¾æ件å¾çå¨ç°å¨çå±å¹ä¸é¢çåæ ï¼è¿åçæ¯ä¸ä¸ªå
ç»(top, left, width, height)20# å¦ææªå¾æ²¡æ¾å°ï¼pyautogui.locateOnScreen()å½æ°è¿åNone21startTime = datetime.datetime.now()22pyautogui.screenshot(r'C:\region_screenshot.png', region=(0, 0, 300, 300))23time.sleep(10)24endTime = datetime.datetime.now()25sub = endTime.second -startTime.second26print(str(sub)+'ç§')27a = pyautogui.locateOnScreen(r'C:\region_screenshot.png') #å®ä½æªå¾çä½ç½® 左顶ç¹ï¼å®½é«28print(a) # æå°ç»æ为Box(left=0, top=0, width=300, height=400)29x, y = pyautogui.center(a) # è·å¾æ件å¾çå¨ç°å¨çå±å¹ä¸é¢çä¸å¿åæ 30print(x, y) # æå°ç»æ为150 20031x, y = pyautogui.locateCenterOnScreen(r'C:\region_screenshot.png') #å®ä½æªå¾çä¸å¿åæ 32print(x, y) # æå°ç»æ为150 20033# å¹é
å±å¹ææä¸ç®æ å¾çç对象ï¼å¯ä»¥ç¨for循ç¯ålist()è¾åº34pyautogui.locateAllOnScreen(r'C:\region_screenshot.png')35for pos in pyautogui.locateAllOnScreen(r'C:\region_screenshot.png'):36 print(pos)37# æå°ç»æ为Box(left=0, top=0, width=300, height=400)38a = list(pyautogui.locateAllOnScreen(r'C:\region_screenshot.png'))...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!