selenium 定位不到元素
from selenium import webdriverfrom selenium.webdriver.support.ui import WebDriverWait
import time
path = r'C:\Users\hzhb\AppData\Roaming\Mozilla\Firefox\Profiles\0sxz7ow0.default'
profile = webdriver.FirefoxProfile(path)
b = webdriver.Firefox(profile)
b.get('http://pan.baidu.com')
time.sleep(5)
user_pwd_login = WebDriverWait(b, 5, 0.5).until(lambda x: x.find_element_by_id('TANGRAM__PSP_4__footerULoginBtn'))
user_pwd_login.click()
username = WebDriverWait(b, 5, 0.5).until(lambda x: x.find_element_by_name('pass-text-input pass-text-input-userName'))
username.send_keys('18716008303')
pwd = WebDriverWait(b, 5, 0.5).until(lambda x: x.find_element_by_name('pass-text-input pass-text-input-password'))
username.send_keys('1739947940zz')
b.find_element_by_id('TANGRAM__PSP_4__submit').click()
time.sleep(5)
cookie = b.get_cookies()
print cookie
b.quit()
C:\Users\hzhb\Desktop\1.jpg 百度云盘的账号密码都暴露啦;P b.find_element_by_id('TANGRAM__PSP_4__submit').click()
这个元素定位不到? zx770693094 发表于 2018-5-9 15:43
百度云盘的账号密码都暴露啦
谢谢提醒,密码已改 zx770693094 发表于 2018-5-9 15:46
b.find_element_by_id('TANGRAM__PSP_4__submit').click()
这个元素定位不到?
对,就是这一个元素,脚本运行不报错,脚本就一直运行,不是frame 的问题
页:
[1]