Update xpath
This commit is contained in:
parent
1c58b53a45
commit
921d193026
3
xpath.md
3
xpath.md
|
@ -28,6 +28,7 @@ layout: default
|
||||||
| `#id` | `//[@id="id"]` | [?](#predicates) |
|
| `#id` | `//[@id="id"]` | [?](#predicates) |
|
||||||
| `.class` | `//[@class="class"]` *...see below* | |
|
| `.class` | `//[@class="class"]` *...see below* | |
|
||||||
| `input[type="submit"]` | `//input[@type="submit"]` | |
|
| `input[type="submit"]` | `//input[@type="submit"]` | |
|
||||||
|
| `a#abc[for="xyz"]` | `//a[@id="abc"][@for="xyz"]` | [?](#chaining-order) |
|
||||||
| --- | --- | |
|
| --- | --- | |
|
||||||
| `a[href^='/']` | `//a[starts-with(@href, '/')]` | [?](#string-functions) |
|
| `a[href^='/']` | `//a[starts-with(@href, '/')]` | [?](#string-functions) |
|
||||||
| `a[href$='pdf']` | `//a[ends-with(@href, '.pdf')]` | |
|
| `a[href$='pdf']` | `//a[ends-with(@href, '.pdf')]` | |
|
||||||
|
@ -41,7 +42,7 @@ layout: default
|
||||||
| `ul > li:nth-child(2)` | `//ul/li[2]` | |
|
| `ul > li:nth-child(2)` | `//ul/li[2]` | |
|
||||||
| `ul > li:last-child` | `//ul/li[last()]` | |
|
| `ul > li:last-child` | `//ul/li[last()]` | |
|
||||||
| --- | --- | |
|
| --- | --- | |
|
||||||
| `li#id:first-child` | `//li[@id="id"][1]` | [?](#chaining-order) |
|
| `li#id:first-child` | `//li[@id="id"][1]` | |
|
||||||
| --- | --- | |
|
| --- | --- | |
|
||||||
| `a:first-child` | `//a[1]` | |
|
| `a:first-child` | `//a[1]` | |
|
||||||
| `a:last-child` | `//a[last()]` | |
|
| `a:last-child` | `//a[last()]` | |
|
||||||
|
|
Loading…
Reference in New Issue