#!/usr/bin/env
#coding=utf-8
from selenium import webdriver
import time
url="http://mail.163.com"
upload=webdriver.Firefox()
upload.get(url)
print "Current url is: %s" %upload.current_url
upload.find_element_by_id("idInput").clear()
upload.find_element_by_id("idInput").send_keys("*****@163.com")
upload.find_element_by_id("pwdInput").send_keys("********")
upload.find_element_by_id("loginBtn").submit()
time.sleep(10)
#upload.find_element_by_link_text("文件中心").submit()
#upload.find_element_by_xpath("//span[@title='文件中心']").submit()
upload.find_element_by_id('_mail_component_103_103').click()
#upload.find_element_by_xpath("//div[@id='_mail_component_103_103']/span[2]").submit()
#upload.find_element_by_xpath('/html/body/div[1]/nav/div[2]/ul/li[15]/div/span[2]').submit()
time.sleep(5)
#window=upload.find_element_by_id("uploaderFlashFile")
#"#"标注不成功的定位,目前“上传文件”按钮定位不成功,上传文件未实现,待解决
#upload.find_element_by_xpath("//*[@id='mainContent']/div[3]/div[1]/div[1]/div[4]/div[1]/span[2]").click()
time.sleep(10)
#upload.find_element_by_xpath("//div[@class='nui-toolbar']/div[4]/div[1]/span[2]").send_keys("/home/admin/Downloads/fonts-chinese-3.02-12.el5.noarch.rpm")