from public import login from public import logout import time from excel import data driver = webdriver.Chrome('F:\driver\chromedriver_win32_0625\chromedriver.exe') login.open(driver, '金康高科', 'guest', '789996') #点击组织管理 time.sleep(1) driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div/ul/li[2]/a").click() #点击运营中心管理 time.sleep(1) driver.find_element_by_xpath("//*[@id='menu_left']/ul/li[1]/a").click() time.sleep(3) #点击新建运营中心按钮 driver.find_element_by_xpath("//*[@id='app']/div/div[4]/div/div[2]/div/div[1]/div[2]/div[1]/a/span[2]").click() time.sleep(1) #输入运营中心的名称 driver.find_element_by_xpath("//*[@id='app']/div/div[4]/div/div[2]/div/div[1]/div[2]/div[2]/div[1]/form/div[1]/div/div/input").send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_yyzx.xls')[0]) driver.find_element_by_xpath("//*[@id='app']/div/div[4]/div/div[2]/div/div[1]/div[2]/div[2]/div[1]/form/div[2]/div/div/input").send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_yyzx.xls')[1]) driver.find_element_by_xpath("//*[@id='app']/div/div[4]/div/div[2]/div/div[1]/div[2]/div[2]/div[2]/div/button[1]/span").click() time.sleep(3) #输入密码和确认密码 driver.find_element_by_xpath("//*[@id='app']/div/div[4]/div/div[2]/div/div[1]/div[2]/div[2]/div[1]/div[2]/form/div[5]/div/div/input").send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_yyzx.xls')[2]) driver.find_element_by_xpath("//*[@id='app']/div/div[4]/div/div[2]/div/div[1]/div[2]/div[2]/div[1]/div[2]/form/div[6]/div/div/input").send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_yyzx.xls')[3]) driver.find_element_by_xpath("//*[@id='app']/div/div[4]/div/div[2]/div/div[1]/div[2]/div[2]/div[1]/div[2]/form/div[7]/div/div/input").send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_yyzx.xls')[4]) #点击保存按钮 driver.find_element_by_xpath("//*[@id='app']/div/div[4]/div/div[2]/div/div[1]/div[2]/div[2]/div[2]/div/button/span").click() time.sleep(2) logout.logout(driver)
time.sleep(1) driver.find_element_by_xpath( '//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[2]/div[2]/div[1]/button/span' ).click() time.sleep(2) driver.find_element_by_xpath( '//*[@id="companyinfos_box"]/div[1]/form/div[1]/div/div/div/input').click( ) time.sleep(1) driver.find_element_by_xpath( '/html/body/div[2]/div[1]/div[1]/ul/li[1]/span').click() #输入门店名称 driver.find_element_by_xpath( '//*[@id="companyinfos_box"]/div[1]/form/div[2]/div/div[1]/input' ).send_keys( data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_md1.xls') [0]) driver.find_element_by_xpath( '//*[@id="companyinfos_box"]/div[1]/form/div[6]/div/div[1]/div[1]/span' ).click() time.sleep(1) driver.find_element_by_xpath( '//*[@id="companyinfos_box"]/div[1]/form/div[6]/div/div[1]/div[1]/div/ul/li[1]' ).click() driver.find_element_by_xpath( '//*[@id="companyinfos_box"]/div[1]/form/div[6]/div/div[2]/div/input' ).send_keys( data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_md1.xls') [1]) driver.find_element_by_xpath( '//*[@id="companyinfos_box"]/div[1]/form/div[7]/div/div[1]/input' ).send_keys(
#!/usr/bin/env python # -*- coding:utf-8 -*- from selenium import webdriver from public import login from public import logout from excel import data import time driver = webdriver.Chrome('F:\driver\chromedriver_win32_0625\chromedriver.exe') login.open(driver,'金康高科','guest','789996') driver.find_element_by_xpath('//*[@id="app"]/div/div[3]/div/ul/li[2]/a').click() time.sleep(2) driver.find_element_by_xpath('//*[@id="menu_left"]/ul/li[4]/a').click() time.sleep(3) driver.find_element_by_xpath('//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[2]/div[1]/form/div[6]/div/div/input').send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_mdxfZB.xls')[0]) driver.find_element_by_xpath('//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[2]/div[1]/form/button[1]/span').click() time.sleep(1) driver.find_element_by_xpath('//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[2]/div[2]/div[2]/div[1]/div[4]/div[2]/table/tbody/tr/td[14]/div/span').click() time.sleep(2) driver.find_element_by_xpath('//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[2]/div[1]/div[2]/span').click() time.sleep(2) driver.find_element_by_name('fileX').send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_mdxfZB.xls')[1]) time.sleep(1) driver.find_element_by_xpath('//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[6]/div/div[3]/div/button[1]/span').click() time.sleep(2) logout.logout(driver)
driver = webdriver.Chrome('F:\driver\chromedriver_win32_0625\chromedriver.exe') login.open(driver, '金康高科华中区', 'admin', '123456') #点击组织管理 time.sleep(2) driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div/ul/li[2]/a").click() time.sleep(3) #点击服务商管理菜单 driver.find_element_by_xpath("//*[@id='menu_left']/ul/li[1]/a").click() time.sleep(2) #点击新建服务商按钮 driver.find_element_by_xpath("//*[@id='app']/div/div[4]/div/div[2]/div/div[1]/div[3]/div[1]/div[2]/div[1]/button/span").click() time.sleep(3) #输入服务商的基本信息 #输入服务商全称 driver.find_element_by_xpath("//*[@id='companyinfos_box']/div[1]/form/div[1]/div/div/input").send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_fws.xls')[0]) #输入服务商简称 driver.find_element_by_xpath("//*[@id='companyinfos_box']/div[1]/form/div[2]/div/div[1]/input").send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_fws.xls')[1]) #输入所属收银系统 driver.find_element_by_xpath("//*[@id='companyinfos_box']/div[1]/form/div[3]/div/div/input").send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_fws.xls')[2]) #填写负责人 driver.find_element_by_xpath("//*[@id='companyinfos_box']/div[1]/form/div[4]/div/div/input").send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_fws.xls')[3]) #填写手机号 driver.find_element_by_xpath("//*[@id='companyinfos_box']/div[1]/form/div[5]/div/div/input").send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_fws.xls')[4]) #找到省份输入框的位置 driver.find_element_by_xpath("//*[@id='companyinfos_box']/div[1]/form/div[6]/div/div[1]/div[1]/span").click() time.sleep(3) #输入省份、城市、区域信息 driver.find_element_by_xpath("//*[@id='companyinfos_box']/div[1]/form/div[6]/div/div[1]/div[1]/div/ul/li[1]").click() #填写具体地址 driver.find_element_by_xpath("//*[@id='companyinfos_box']/div[1]/form/div[6]/div/div[2]/div/input").send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_fws.xls')[5])
from public import logout import time from excel import data driver = webdriver.Chrome('F:\driver\chromedriver_win32_0625\chromedriver.exe') login.open(driver, '金康高科', 'guest', '789996') driver.find_element_by_xpath( '//*[@id="app"]/div/div[3]/div/ul/li[5]/a').click() time.sleep(2) driver.find_element_by_xpath( '//*[@id="app"]/div/div[4]/div/div[1]/div[2]/ul/li/a').click() time.sleep(1) driver.find_element_by_xpath( '//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[2]/div[3]/div/form[1]/div[4]/div/div/div/input' ).send_keys( data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_fwfDCZ.xls') [0]) driver.find_element_by_xpath( '//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[2]/div[3]/div/form[1]/div[5]/div/button/span' ).click() time.sleep(1) driver.find_element_by_xpath( '//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[2]/div[5]/div[1]/div[3]/table/tbody/tr/td[10]/div/span[1]' ).click() time.sleep(1) driver.find_element_by_xpath( '//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[1]/div/form/div[3]/div/div/div/input' ).send_keys( data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_fwfDCZ.xls') [1]) #上传图片 driver.find_element_by_name('fileX').send_keys(
driver = webdriver.Chrome('F:\driver\chromedriver_win32_0625\chromedriver.exe') login.open(driver, '利楚', 'admin', '123456') time.sleep(2) driver.find_element_by_xpath('//*[@id="app"]/div/div[3]/div/ul/li[2]/a').click() time.sleep(1) driver.find_element_by_xpath('//*[@id="menu_left"]/ul/li[3]/a').click() time.sleep(1) driver.find_element_by_xpath('//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[2]/div[2]/div[1]/button/span').click() time.sleep(2) driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[1]/form/div[1]/div/div/div/input').click() time.sleep(1) driver.find_element_by_xpath('/html/body/div[2]/div[1]/div[1]/ul/li[1]/span').click() #输入门店名称 driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[1]/form/div[2]/div/div[1]/input').send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_md2.xls')[0]) driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[1]/form/div[5]/div/div/label[2]/span[1]/span').click() a = driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[1]/form/div[6]/div/div[1]/input') a.send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_md2.xls')[1]) a.send_keys(Keys.ENTER) driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[1]/form/div[7]/div/div[1]/div[1]/span').click() time.sleep(1) driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[1]/form/div[7]/div/div[1]/div[1]/div/ul/li[1]').click() driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[1]/form/div[7]/div/div[2]/div/input').send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_md2.xls')[2]) driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[1]/form/div[8]/div/div/input').send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_md2.xls')[3]) driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[1]/form/div[9]/div/div/input').send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_md2.xls')[4]) driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[2]/form/div[1]/div/div/input').send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_md2.xls')[5]) driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[2]/form/div[2]/div/div/input').send_keys(data.read_excela(r'D:\Python project\yunyingpingtai\excel\test_md2.xls')[6]) driver.find_element_by_xpath('//*[@id="companyinfos_box"]/div[3]/div/button/span').click() time.sleep(2) driver.find_element_by_xpath('//*[@id="app"]/div/div[4]/div/div[2]/div/div[1]/div[3]/div/div[3]/span/button[2]/span').click()