from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Chrome()
url = 'http://cots.ccnu.edu.cn/index/index/student.html#'
driver.get(url)
driver.implicitly_wait(20)
search = driver.find_elements_by_class_name('bs-searchbox')
driver.find_element_by_xpath("//button[@title='请选择省']").click()
search[0].find_element_by_class_name('form-control').send_keys('辽宁')
search[0].find_element_by_class_name('form-control').send_keys(Keys.ENTER)
driver.find_element_by_xpath("//button[@title='请选择学校']").click()
search[1].find_element_by_class_name('form-control').send_keys('沈阳工业大学')
search[1].find_element_by_class_name('form-control').send_keys(Keys.ENTER)
time.sleep(0.5)
driver.find_element_by_xpath("//a[@rel='q0_2_1']").click()
driver.find_element_by_xpath("//a[@rel='q0_3_2']").click()
driver.find_element_by_xpath
python+selenium填写一次学校试卷
最新推荐文章于 2023-06-26 10:03:58 发布