selenium中有截图的操作 使用save_screenshot方法保存图片
driver.save_screenshot("code.jpg")
想觉得图片太大 剪辑图片可以使用PIL中的Image模块剪辑
img = Image.open("code.jpg")region = (10, 10, 100, 100)nimg = img.crop(region)nimg.save("new_code.jpg")
最好去学下 Python OCR 相关知识,求人不如求己