关于爬虫代码优化的 问题
from selenium import webdriverimport time
driver = webdriver.Chrome()
driver.get('**************')#打开教务系统 保护隐私此处不显示
time.sleep(2)#延时2s 防止网络缓慢
#输入账号密码
driver.find_element_by_xpath('//*[@id="input_username"]').send_keys('*******')#此处需要修改自己的账号
driver.find_element_by_xpath('//*[@id="input_password"]').send_keys('***********')#此处需要修改自己的密码
time.sleep(8)#延时8s 手动输入验证码
driver.find_element_by_xpath('//*[@id="loginButton"]').click()#点击登录
time.sleep(2)#延时2s 用于登录时间
#打开教学评估
driver.find_element_by_xpath('//*[@id="12580300"]/a/span').click()
time.sleep(1)#延时1s 用于加载网页等待时间
driver.find_element_by_xpath('//*[@id="12580302"]/a').click()
time.sleep(1)#延时1s 用于加载网页等待时间
#点各个老师评价
driver.find_element_by_xpath('//*[@id="jxpgtbody"]/tr/td/button').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/textarea').send_keys('这老师不赖')#此处需要修改自己对老师的评价
time.sleep(123)#用于等待系统时间
driver.find_element_by_xpath('//*[@id="buttonSubmit"]').click()
time.sleep(37)#用于等待系统响应时间
driver.find_element_by_xpath('//*[@id="jxpgtbody"]/tr/td/button').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/textarea').send_keys('这老师不赖')#此处需要修改自己对老师的评价
time.sleep(123)#用于等待系统时间
driver.find_element_by_xpath('//*[@id="buttonSubmit"]').click()
time.sleep(5)#用于等待系统响应时间
driver.find_element_by_xpath('//*[@id="jxpgtbody"]/tr/td/button').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/textarea').send_keys('这老师不赖')#此处需要修改自己对老师的评价
time.sleep(123)#用于等待系统时间
driver.find_element_by_xpath('//*[@id="buttonSubmit"]').click()
time.sleep(5)#用于等待系统响应时间
driver.find_element_by_xpath('//*[@id="jxpgtbody"]/tr/td/button').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/textarea').send_keys('这老师不赖')#此处需要修改自己对老师的评价
time.sleep(123)#用于等待系统时间
driver.find_element_by_xpath('//*[@id="buttonSubmit"]').click()
time.sleep(5)#用于等待系统响应时间
driver.find_element_by_xpath('//*[@id="jxpgtbody"]/tr/td/button').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/textarea').send_keys('这老师不赖')#此处需要修改自己对老师的评价
time.sleep(123)#用于等待系统时间
driver.find_element_by_xpath('//*[@id="buttonSubmit"]').click()
time.sleep(5)#用于等待系统响应时间
driver.find_element_by_xpath('//*[@id="jxpgtbody"]/tr/td/button').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/textarea').send_keys('这老师不赖')#此处需要修改自己对老师的评价
time.sleep(123)#用于等待系统时间
driver.find_element_by_xpath('//*[@id="buttonSubmit"]').click()
time.sleep(5)#用于等待系统响应时间
driver.find_element_by_xpath('//*[@id="jxpgtbody"]/tr/td/button').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/textarea').send_keys('这老师不赖')#此处需要修改自己对老师的评价
time.sleep(123)#用于等待系统时间
driver.find_element_by_xpath('//*[@id="buttonSubmit"]').click()
time.sleep(5)#用于等待系统响应时间
driver.find_element_by_xpath('//*[@id="jxpgtbody"]/tr/td/button').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/textarea').send_keys('这老师不赖')#此处需要修改自己对老师的评价
time.sleep(123)#用于等待系统时间
driver.find_element_by_xpath('//*[@id="buttonSubmit"]').click()
time.sleep(5)#用于等待系统响应时间
driver.find_element_by_xpath('//*[@id="jxpgtbody"]/tr/td/button').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/textarea').send_keys('这老师不赖')#此处需要修改自己对老师的评价
time.sleep(123)#用于等待系统时间
driver.find_element_by_xpath('//*[@id="buttonSubmit"]').click()
time.sleep(5)#用于等待系统响应时间
driver.find_element_by_xpath('//*[@id="jxpgtbody"]/tr/td/button').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/textarea').send_keys('这老师不赖')#此处需要修改自己对老师的评价
time.sleep(123)#用于等待系统时间
driver.find_element_by_xpath('//*[@id="buttonSubmit"]').click()
由于太懒不想一个一个点评价所以就现学一下爬虫但是又不太懂python我想把后面的#点各个老师评价部分可不可以写成一个for循环呢 求大佬能不能改一下或者解答一下 太可以了 像这样有规律的都可以循环一下:
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr/td/div/label/span').click()
for x in range(3,42,2):
driver.find_element_by_xpath('//*[@id="page-content-template"]/div/div/div/form/div/table/tbody/tr[%d]/td/div/label/span'%x).click()
wp231957 发表于 2021-6-14 08:06
像这样有规律的都可以循环一下:
哦,太感谢你了
页:
[1]