Update xpath
This commit is contained in:
parent
ea76b24ce8
commit
4610903e23
19
xpath.md
19
xpath.md
|
@ -23,15 +23,16 @@ layout: default
|
||||||
|
|
||||||
### Attribute selectors
|
### Attribute selectors
|
||||||
|
|
||||||
| CSS | Xpath | ? |
|
| CSS | Xpath | ? |
|
||||||
| --- | --- | --: |
|
| --- | --- | --: |
|
||||||
| `#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#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')]` | |
|
||||||
|
| `a[href~='://']` | `//a[contains(@href, '://')]` *...kinda* | |
|
||||||
{:.greycode.no-head}
|
{:.greycode.no-head}
|
||||||
|
|
||||||
### Order selectors
|
### Order selectors
|
||||||
|
|
Loading…
Reference in New Issue