webdriver-python-163邮箱上传文件

#!/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")

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值