基础自动化
#coding=utf-8
'''
2020年9月21日
'''
from selenium import webdriver
from time import sleep
import re
import random
def status():
i = 0
cishu = 400
option = webdriver.ChromeOptions()
option.add_argument('disable-infobars')
driver = webdriver.Chrome()
driver.get("http://xxxxxxxx") #访问地址
sleep(3)
driver.find_element_by_xpath('//*[@id="app"]/div/div/div[2]/div/form/div[2]/div/div/input').clear()
sleep(2)
driver.find_element_by_xpath('//*[@id="app"]/div/div/div[2]/div/form/div[1]/div/div/label[3]/span[1]/span').click()
sleep(2)
driver.find_element_by_xpath('//*[@id="app"]/div/div/div[2]/div/form/div[2]/div/div/input').send_keys('巴南科委')
sleep(2)
driver.find_element_by_xpath('//*[@id="app"]/div/div/div[2]/div/form/div[4]/div/div/div[1]/div/input').send_keys('aqsa')
sleep(2)
driver.find_element_by_xpath('//*[@id="app"]/div/div/div[2]/div/form/div[5]/div/button').click()
sleep(3)
driver.find_element_by_xpath('//*[@id="app"]/div/div[1]/div[1]/div/div[2]/div[1]/div/ul/div/li[2]/div').click()
sleep(1)
driver.find_element_by_xpath('//*[@id="app"]/div/div[1]/div[1]/div/div[2]/div[1]/div/ul/div/li[2]/ul/li').click() #进入申报书管理页面
sleep(3)
driver.find_element_by_xpath('//*[@id="tab-qxsh"]').click() #进入区县审核Tab
driver.implicitly_wait(10)
# driver.find_elements_by_css_selector("#el-collapse-content-5753 > div > div > div:nth-child(2) > div > div > div > input").append('wwww')
# sleep(2)
# driver.find_element_by_class_name('el-icon-check').click() #搜索
# sleep(2)
while i <= cishu: ##循环
driver.find_element_by_xpath('//*[@id="sbsgl_crud"]/div[3]/div[4]/div[2]/table/tbody/tr[1]/td[8]/div/div/button[2]').click() #提交
driver.implicitly_wait(10)
# driver.find_element_by_xpath('/html/body/div[2]/div/div[3]/button[2]/span').click() # 确认提交
# sleep(5)
driver.find_element_by_xpath('/html/body/div[2]/div/div[3]/button[2]/span').click() #确认提交
sleep(5)
i+=1
driver.add_experimental_option("detach", True)
status()
# driver.close()
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。