time.sleep(3) #加载等待
print(“点击单位登录”)
time.sleep(3) #加载等待
driver.find_element_by_xpath(“/html/body/div[1]/div[2]/div/div[2]/div[2]/button”).click()#点击单位登录
time.sleep(3) #加载等待
print(“正在填写账号”)
elem = driver.find_element_by_xpath(“/html/body/div[4]/div/div[1]/div/div[2]/form[1]/div[1]/div/input”)
清空原有内容
elem.clear()
填入账号
elem.send_keys(“”)
time.sleep(1) #加载等待
print(“正在填写密码”)
elem = driver.find_element_by_xpath(“/html/body/div[4]/div/div[1]/div/div[2]/form[1]/div[2]/div/input”)
清空原有内容
elem.clear()
填入密码
elem.send_keys(“”)
time.sleep(1) #加载等待
print(“正在查看验证码”)
driver.find_element_by_xpath(“/html/body/div[4]/div/div[1]/div/div[2]/form[1]/div[3]/div/input”).click()#查看验证码
print(“请输入验证码”)
yanzhengma=input()
time.sleep(1) #加载等待
driver.find_element_by_xpath(“/html/body/div[4]/div/div[1]/div/div[2]/form[1]/div[4]/div/label/input”).click()#勾选
time.sleep(1) #加载等待
填入验证码
elem = driver.find_element_by_xpath(“/html/body/div[4]/div/div[1]/div/div[2]/form[1]/div[3]/div/input”)
elem.clear()
elem.send_keys(str(yanzhengma))
time.sleep(1) #加载等待
print(“正在登陆”)
driver.find_element_by_xpath(“/html/body/div[4]/div/div[1]/div/div[2]/form[1]/div[5]/button”).click()#点击
点击违法查询,设置查询时间
driver.find_element_by_xpath(“/html/body/div[4]/div/div[1]/div/div[2]/form[1]/div[5]/button”).click()#点击
time.sleep(3) #加载等待
driver.find_element_by_xpath(“/html/body/div[4]/div/div[1]/ul/li[5]/a”).click()#点击违法查询
time.sleep(1) #加载等待
driver.find_element_by_xpath(“/html/body/div[3]/div/div[2]/div[1]/div[2]/form/div[1]/div/div[1]/span/i”).click()#点击选择日期
for i in range(3):
time.sleep(0.5) #加载等待
driver.find_element_by_xpath(“/html/body/div[6]/div[4]/table/thead/tr/th[1]/i”).click()#点击
time.sleep