#!author zhang
from selenium import webdriver
from time import sleep,ctime
driver = webdriver.Firefox()
driver.get("http://www.baidu.com") def testxpath2(yuansu):
for i in range(10):
try:
element = driver.find_element_by_xpath(yuansu)
if element.is_displayed():
return driver.find_element_by_xpath(yuansu)
break except:pass
sleep(1)
else:
print("no yunaus") testxpath2(".//*[@id='kw']").send_keys("iifffii")
相关文章
- webdriver 获取佰词斩的单词(涉及字符串转换)
- Selenium WebDriver 工作原理
- 常见浏览器 WebDriver 驱动下载
- 使用Webdriver执行JS小结
- 电大计算机人文英语,电大人文英语3until1until8边学边练.docx
- Selenium的PO模式(Page Object Model)|(Selenium Webdriver For Python)
- Selenium自动化测试Python三:WebDriver进阶
- 谷歌浏览器的各个版本对应的webdriver(chromedrive)-超级详细
- ERROR: current transaction is aborted, commands ignored until end of transaction block
- web自动化测试从入门到持续集成(selenium webdriver)