标签:select window common dal china 信息 tps graph tab
from selenium import webdriver
import time
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import Select
import os
driver=webdriver.Chrome()
#登录
driver.get("https://ftanjian.chinabeacon.cn/Login.html")
driver.set_window_size(1440,900)
now_url=driver.current_url
print(now_url)
time.sleep(2)
driver.find_element_by_id("txt_LoginName").send_keys("shanxiaofang")
driver.find_element_by_id("txt_Password").send_keys("123")
time.sleep(2)
driver.find_element_by_css_selector(".login_btn>button").click()
time.sleep(5)
#企业库
driver.find_element_by_link_text("企业库").click()
time.sleep(8)
#查询新增的企业
driver.find_element_by_id("EnterpriseName").send_keys("自动化测试")
time.sleep(1)
driver.find_element_by_id("btn_search").click()
time.sleep(2)
#选定企业
driver.find_element_by_xpath(".//*[@id=‘enterprise_list‘]/tr[1]/td[4]").click()
time.sleep(1)
#打开编辑企业页面
driver.find_element_by_id("btn_edit_enterprise").click()
time.sleep(8)
#打开经营信息页面
driver.find_element_by_link_text("经营信息").click()
time.sleep(8)
#上传文件
upload=driver.find_element_by_xpath("//*[@id=‘uploadifive-EnterpriseIchnographyPictureId‘]/input[2]")
upload.send_keys("F:\\aa.png")
time.sleep(5)
#提交编辑内容
driver.find_element_by_css_selector("#tab2_submit_form > div > button.btn_common.j-btnSubmit").click()
#关闭确认提交成功按钮
driver.find_element_by_xpath("//*[@id=‘alert_hint_modal‘]/div[2]/div[3]/span").click()
time.sleep(5)
driver.find_element_by_css_selector("#tab2_submit_form > div > button.btn_common.j-btnBack").click()
标签:select window common dal china 信息 tps graph tab
原文地址:https://www.cnblogs.com/zuoyinai/p/9156809.html