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')

  

posted @ 2015-01-09 22:45  Mr.Dantes  阅读(124)  评论(0编辑  收藏  举报