Skip to content

Commit 41b2df1

Browse files
committed
Added info to the XPath selector docstring
1 parent 10eef86 commit 41b2df1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scrapy_webdriver/selector.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@ def _make_result(self, result):
2727
for e in result]
2828

2929
def select(self, xpath):
30-
"""Return elements using webdriver `find_elements_by_xpath` method."""
30+
"""Return elements using the webdriver `find_elements_by_xpath` method.
31+
32+
Some XPath features are not supported by the webdriver implementation.
33+
Namely, selecting text content or attributes:
34+
- /some/element/text()
35+
- /some/element/@attribute
36+
37+
This function offers workarounds for both, so it should be safe to use
38+
them as you would with HtmlXPathSelector for simple content extraction.
39+
40+
"""
3141
xpathev = self.element if self.element else self.webdriver
3242
ending = _UNSUPPORTED_XPATH_ENDING.match(xpath)
3343
atsign = parens = None

0 commit comments

Comments
 (0)