为公园添加Note/Alert信息:
添加了Note或者Alert后点击APPLY将会出现Sites标签,点进去为它分配sites。
下面是未封装的实现代码:
from selenium import webdriver
import time
import xlrd
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException, NoSuchElementException
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import Select
""""""
url = 'https://reserveamerica.com/xxx'
account_user = 'xxx'
account_password = 'xxx'
wb = xlrd.open_workbook('D://AddNotesandAlerts.xls')
""""""
sheet1 = wb.sheet_by_index(0)
contract = sheet1.col_values(0)[1].strip()
park_name = sheet1.col_values(1)[1].strip()
type_name = sheet1.col_values(2)
error = ''
# Open firefox browser with addons and go to Orms page
driver = webdriver.Firefox(executable_path='D:\Selenium 3.14\geckodriver.exe', timeout=5)
driver.delete_all_cookies()
driver.get(url)
driver.maximize_window()
time.sleep(2)
# Input user name on login page
user_name_element = driver.find_element_by_id('userName')
user_name_element.clear()
user_name_element.send_keys(account_user)
# Input password on login page
user_password_element = driver.find_element_by_id('password')
user_password_element.clear()
user_password_element.send_keys(account_password)
# Login
ok_button = driver.find_element_by_id('okBtnAnchor')
ok_button.click()
time.sleep(2)
# Choose contract
contract_option = driver.find_element_by_xpath("//option[text()='" + contract + " Contract']")
contract_option.click()
time.sleep(2)
# Go to Inventory Manager page
finance_manager = dr