1. 用By定位元素 除了前面介绍的单位方法,WebDriver还提供了另外一套写法,即统一调用find_element()方法,通过By来声明定位的方法,并且传入对应定位方法的定位参数.具体如下: from time import sleep from selenium import webdriver from selenium.webdriver.common.by import By wd = webdriver.Chrome() wd.get('https://www.baidu.co…
在图片上双击过的位置绘制一个 圆圈 鼠标事件就是和鼠标有关的,比如左键按下,左键松开,右键按下,右键松开,双击右键等等. 我们可以通过鼠标事件获得与鼠标对应的图片上的坐标.我们通过以下函数来调用查看所有鼠标事件. events=[i for i in dir(cv2) if 'EVENT'in i] print events 所有的鼠标事件 我们来是这写一下这个函数,第一步还是调用库 import cv2 import numpy as np 调用鼠标回调函数 def draw_circle(…