码迷,mamicode.com
首页 > Web开发 > 详细

selenium.webdriver.common.by之By

时间:2019-09-02 13:59:30      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:xpath   sele   cto   div   ring   pat   sel   path   css_   

By支持的定位:

  1. CLASS_NAME = ‘class name‘
  2. CSS_SELECTOR = ‘css selector‘
  3. ID = ‘id‘
  4. LINK_TEXT = ‘link text‘
  5. NAME = ‘name‘
  6. PARTIAL_LINK_TEXT = ‘partial link text‘
  7. TAG_NAME = ‘tag name‘
  8. XPATH = ‘xpath‘

导入by:

from selenium.webdriver.common.by import By

用法:

#用户名输入框
element=(By.ID,‘user_name‘)

  

selenium.webdriver.common.by之By

标签:xpath   sele   cto   div   ring   pat   sel   path   css_   

原文地址:https://www.cnblogs.com/Arcy/p/11445881.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!