python+selenium自动化测试,读取csv文件,

#   coding:utf-8
#   date:2019/1/7


from selenium import webdriver
import csv
import time


dates = csv.reader(open("E:\\test\\CSV\\test01.csv",'r'))
list = []
for date in dates:
    if date == 0:
        pass
    else:
        list.append(date)
print(list)
print(list[0])
print(list[0][0])
print(list[0][1])
driver = webdriver.Chrome()
driver.maximize_window()
driver.get("https://*******.com/login")
time.sleep(3)
driver.find_element_by_name("mobile").send_keys(list[1][0])
driver.find_element_by_name("password").send_keys(list[1][1])
driver.find_element_by_class_name("u-passport-submit-btn").click()

time.sleep(2)
driver.quit()

你可能感兴趣的:(python+selenium自动化测试,读取csv文件,)