软件测试任务驱动教程电子活页4-9文件seleniumTestDemo14.py的完整代码.docxVIP

  • 0
  • 0
  • 约小于1千字
  • 约 1页
  • 2026-03-12 发布于山东
  • 举报

软件测试任务驱动教程电子活页4-9文件seleniumTestDemo14.py的完整代码.docx

PAGE2

PAGE21

软件测试任务驱动教程

PAGE2

文件seleniumTestDemo14.py的完整代码

fromseleniumimportwebdriver

importtime

frommon.byimportBy

#打开Chrome浏览器

driver=webdriver.Chrome()

driver.get(/)

#使用find_elements(By.TAG_NAME,value)方法定位

tag=driver.find_elements(By.TAG_NAME,input)

#遍历tag

forbaiduintag:

ifbaidu.get_attribute(autocomplete)==off:

baidu.send_keys(Python)

#单击“百度一下”按钮

driver.find_element(By.ID,su).click()

time.sleep(5)

driver.quit()

文档评论(0)

1亿VIP精品文档

相关文档