diff --git a/requests_html.py b/requests_html.py index 06f2bd7..d2281bf 100644 --- a/requests_html.py +++ b/requests_html.py @@ -105,7 +105,9 @@ class BaseParser: return self.lxml.text_content() def find(self, selector, first=False, _encoding=None): - """Given a jQuery selector, returns a list of :class:`Element ` objects.""" + """Given a jQuery selector, returns a list of :class:`Element ` objects. + + If ``first`` is ``True``, only returns the first :class:`Element ` found.""" def gen(): for found in self.pq(selector): yield Element(element=found, url=self.url, default_encoding=_encoding or self.encoding) @@ -121,7 +123,9 @@ class BaseParser: return c def xpath(self, selector, first=False, _encoding=None): - """Given an XPath selector, returns a list of :class:`Element ` objects.""" + """Given an XPath selector, returns a list of :class:`Element ` objects. + + If ``first`` is ``True``, only returns the first :class:`Element ` found.""" c = [Element(element=e, url=self.url, default_encoding=_encoding or self.encoding) for e in self.lxml.xpath(selector)] if first: try: