January 22, 2020
Xpath cheatsheet, XPath用法详解
Xpath test bed
Test queries in the Xpath test bed:
Xpath test bed (whitebeam.org)
Browser console
$x("//div")
Works in Firefox and Chrome.
Selectors
Descendant selectors
h1
//h1
div p
//div//p
ul > li
//ul/li
ul > li > a
//ul/li/a
div > *
//div/*
:root
/
:root > body
/body
Attribute selectors
#id
//*[@id="… Read More