背景:
学院讲座可以加期末综测分,而综测分关系奖学金评比,所以每场讲座火爆。为了限制听讲人数,学院开始更换讲座报名预约形式:定时发放问卷星,截取最先提交的几十名或者一百名为成功报名的人。
使用python+selenium即可实现,但后面发现问某星会检测selenium并需要滑块验证,解决方法为屏蔽检测;寻找滑块元素自动点击。
from selenium import webdriver
from time import sleep
from selenium.webdriver.chrome import options
#1.创建Chrome浏览器对象,并设置参数,屏蔽selenum检测。这会在电脑上在打开一个浏览器窗口
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension'