selenium + pyautogui 实现淘宝自动登录

pip install pyautogui

官网 https://pyautogui.readthedocs.io/en/latest/mouse.html

使用selenium模块打开浏览器,使用pyautogui模拟真人行为

获取按钮的坐标  # 这段代码实时获取鼠标的坐标

import pyautogui, sys
print('Press Ctrl-C to quit.') try: while True: x, y = pyautogui.position() positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4) print(positionStr, end='') print('\b' * len(positionStr), end='', flush=True) except KeyboardInterrupt: print('\n')

猜你喜欢

转载自www.cnblogs.com/shizhengquan/p/12218732.html