zoukankan      html  css  js  c++  java
  • RFS入门【Xpath使用】

    Xpath使用
    https://www.cnblogs.com/unknows/p/7684331.html

    1、id 获取id 的属性值
    2、starts-with 顾名思义,匹配一个属性开始位置的关键字 -- 模糊定位
    3、contains 匹配一个属性值中包含的字符串 -- 模糊定位
    4、text() 函数文本定位
    5、last() 函数位置定位

    <input id="su" class="bg s_btn btnhover" value="百度一下" type="submit"/>
    //*[@id='su'] 获取id 的属性为'su' 的值

    //input[contains(@class,'bg s_btn')]
    //input[@class='bg s_btn btnhover' and @value='百度一下'] --属性 且关系
    //input[@id='su' or @value='百度一下'] --属性 或关系

    <a class="lb" href="https://passport.baidu.com/v2/?login&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F" name="tj_login" onclick="return false;">登录</a>
    //a[starts-with(@name,'tj_lo')] 属性模糊定位
    //a[contains(@name,'tj_lo')] 属性模糊定位

    <a href="http://www.baidu.com">百度搜索</a>
    //a[text()='百度搜索']

    //a[contains(text(),"搜索")] --文本模糊定位

    <a id="setf" href="//www.baidu.com/cache/sethelp/help.html" onmousedown="return ns_c({'fm':'behs','tab':'favorites','pos':0})" target="_blank">把百度设为主页</a>
    //a[text()='把百度设为主页'] --文本精确定位


    <span class="payment">支付方式</span>
    //span[text()='支付方式']

    <a filter-async="" href="#" data-key="pm" data-tj="PC预定流程_车辆列表_支付方式_到店支付" data-value="1">到店支付</a>
    //a[text()='到店支付']

    参考:https://www.cnblogs.com/unknows/p/7684331.html

  • 相关阅读:
    Allegro绘制PCB流程
    KSImageNamed-Xcode
    UIApplicationsharedApplication的常用使用方法
    javascript中间AJAX
    hdu1845 Jimmy’s Assignment --- 完整匹配
    嵌入式控制系统和计算机系统
    Bean行为破坏之前,
    jsonkit 分解nsarray 时刻 一个错误
    IO 字符流学习
    2013级别C++文章9周(春天的)工程——运算符重载(两)
  • 原文地址:https://www.cnblogs.com/aeip/p/9070608.html
Copyright © 2011-2022 走看看