大家做爬虫的时候肯定会遇到很多验证码列如本文所指的图像识别:
![](https://i-blog.csdnimg.cn/blog_migrate/7363687487160e240be75f556785677d.png)
我在爬取拉勾网的时候过于频繁被跳转到了验证系统,真是令人头大
url=安全访问验证-拉勾网
https://sec.lagou.com/verify.html?e=2&f=https://www.lagou.com/jobs/list_python?labelWords=&fromSearch=true&suginput=
![](https://i-blog.csdnimg.cn/blog_migrate/2debaab9c8ad49d8fbac93c9831cf406.png)
![](https://i-blog.csdnimg.cn/blog_migrate/7ac0f3e0e24a61f585c9715a4be84f28.png)
我们需要先点击这里的验证按钮之后就会直接跳出图像验证码,在识别完成之后点击确认就会直接进去到职位页面
![](https://i-blog.csdnimg.cn/blog_migrate/7363687487160e240be75f556785677d.png)
ok,我们先把前面代码写好
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver import ChromeOptions #这个包用来规避被检测的风险
import time #延迟
from chaojiying import Chaojiying_Client
from selenium.webdriver import ActionChains #动作链
option = webdriver.ChromeOptions()
option.add_experimental_option('useAutomationExtension', False)
option.add_experimental_option('excludeSwitches', ['enable-automation'])
driver_path =