py+webdriver学习之旅4:file
__author__ = 'Administrator' from selenium import webdriver import os,time driver=webdriver.Firefox() file_path='file:///'+os.path.abspath('upload_file.html') driver.get(file_path) #输入路径 driver.find_element_by_name("file").send_keys('C:\\Users\Administrator\PycharmProjects\3.1\src\a.txt')