Skip to content

Commit cba7a11

Browse files
committed
Fix param name to match the doc in SelectorList.xpath()
1 parent 80509e4 commit cba7a11

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ Converting CSS to XPath
11301130

11311131
When you're using an API that only accepts XPath expressions, it's sometimes
11321132
useful to convert CSS to XPath. This allows you to take advantage of the
1133-
conciseness of CSS to query elements by classes and the easeness of
1133+
conciseness of CSS to query elements by classes and the easiness of
11341134
manipulating XPath expressions at the same time.
11351135

11361136
On those occasions, use the function :func:`~parsel.css2xpath`:

parsel/selector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __getitem__(self, pos):
7373
def __getstate__(self):
7474
raise TypeError("can't pickle SelectorList objects")
7575

76-
def xpath(self, xpath, namespaces=None, **kwargs):
76+
def xpath(self, query, namespaces=None, **kwargs):
7777
"""
7878
Call the ``.xpath()`` method for each element in this list and return
7979
their results flattened as another :class:`SelectorList`.
@@ -90,7 +90,7 @@ def xpath(self, xpath, namespaces=None, **kwargs):
9090
9191
selector.xpath('//a[href=$url]', url="http://www.example.com")
9292
"""
93-
return self.__class__(flatten([x.xpath(xpath, namespaces=namespaces, **kwargs) for x in self]))
93+
return self.__class__(flatten([x.xpath(query, namespaces=namespaces, **kwargs) for x in self]))
9494

9595
def css(self, query):
9696
"""

0 commit comments

Comments
 (0)