diff --git a/README.md b/README.md index c8f85c9..efb3ae8 100644 --- a/README.md +++ b/README.md @@ -2527,11 +2527,11 @@ from selenium import webdriver #### XPath — also available in lxml, Scrapy, and browser's console via `'$x()'`: ```python - = //[/ or // ] # Child: /, Descendant: //, Parent: /.. - = ///following:: # Next sibling. Also preceding/parent/… + = //[/ or // ] # /, //, /../ + = ///following:: # Next element. Also preceding/parent/… = # ` = */a/…`, ` = [1/2/…]`. = [ [and/or ]] # For negation use `not()`. - = @="" # `.=""` matches complete text. + = @[=""] # `text()=`, `.=` match (complete) text. = contains(@, "") # Is a substring of attr's value? = [//] # Has matching child? Descendant if //. ``` diff --git a/index.html b/index.html index c4582f7..2e19221 100644 --- a/index.html +++ b/index.html @@ -2073,11 +2073,11 @@ print(f'{python_url}, -

XPath — also available in lxml, Scrapy, and browser's console via '$x(<xpath>)':

<xpath>     = //<element>[/ or // <element>]           # Child: /, Descendant: //, Parent: /..
-<xpath>     = //<element>/following::<element>         # Next sibling. Also preceding/parent/…
+

XPath — also available in lxml, Scrapy, and browser's console via '$x(<xpath>)':

<xpath>     = //<element>[/ or // <element>]           # /<child>, //<descendant>, /../<siblng>
+<xpath>     = //<element>/following::<element>         # Next element. Also preceding/parent/…
 <element>   = <tag><conditions><index>                 # `<tag> = */a/…`, `<index> = [1/2/…]`.
 <condition> = [<sub_cond> [and/or <sub_cond>]]         # For negation use `not(<sub_cond>)`.
-<sub_cond>  = @<attr>="<val>"                          # `.="<val>"` matches complete text.
+<sub_cond>  = @<attr>[="<val>"]                        # `text()=`, `.=` match (complete) text.
 <sub_cond>  = contains(@<attr>, "<val>")               # Is <val> a substring of attr's value?
 <sub_cond>  = [//]<element>                            # Has matching child? Descendant if //.