Python操作selenium

2022-01-17 10:43:46 浏览数 (3)

logging用法

代码语言:javascript复制
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
logger.info("test")

pyautogui坐标点击

识别图片

代码语言:javascript复制
coords = pyautogui.locateOnScreen('1.png')

获取坐标

代码语言:javascript复制
x, y = pyautogui.center(coords)

点击坐标

代码语言:javascript复制
pyautogui.leftClick(x, y)

0 人点赞