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

  • 相关阅读:
    epoll 使用详解
    STL 较详尽总结
    可视化对比排序算法
    统治世界的十大算法
    Vector Demo
    Git远程操作(附重要原理图)
    Wireshark(五):TCP窗口与拥塞处理
    Wireshark(四):网络性能排查之TCP重传与重复ACK
    Wireshark(三):应用Wireshark IO图形工具分析数据流
    Wireshark(二):应用Wireshark观察基本网络协议
  • 原文地址:https://www.cnblogs.com/aeip/p/9070608.html
Copyright © 2011-2022 走看看