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