Debug XPath in a browser

Source: Internet
Author: User
Tags xpath

1. Use Google Chrome to download XPath helper and press Ctrl + Shift + X to bring up the dialog box

650) This. width = 650; "Title =" image "style =" border-top: 0px; border-Right: 0px; Background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; padding-right: 0px "border =" 0 "alt =" image "src =" http://img1.51cto.com/attachment/201410/27/8926377_1414395068nz55.png "" 496 "Height =" 252 "/>

2. Enter an expression. The matching part is marked yellow

650) This. width = 650; "Title =" image "style =" border-top: 0px; border-Right: 0px; Background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; padding-right: 0px "border =" 0 "alt =" image "src =" http://img1.51cto.com/attachment/201410/27/8926377_1414395069PDnm.png "" 500 "Height =" 207 "/>

 

TIPS:

1. Space in the exit attribute

For example: <Div class = "WX-Rb wx-rb3"> to match this Div, You need to specify the class value, while XPath does not support space-based Attribute Value matching by default

Use the normalize-space function

Method: // Div [@ class = normalize-space ('wx-Rb wx-rb3 ')]

Debug XPath in a browser

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.