mirror of
https://github.com/kennethreitz/requests-html.git
synced 2026-06-05 06:46:14 +00:00
Merge pull request #485 from python-pitfalls/master
removed a case of the default mutable argument pitfall
This commit is contained in:
+3
-1
@@ -431,12 +431,14 @@ class HTML(BaseParser):
|
|||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return f"<HTML url={self.url!r}>"
|
return f"<HTML url={self.url!r}>"
|
||||||
|
|
||||||
def next(self, fetch: bool = False, next_symbol: _NextSymbol = DEFAULT_NEXT_SYMBOL) -> _Next:
|
def next(self, fetch: bool = False, next_symbol: _NextSymbol = None) -> _Next:
|
||||||
"""Attempts to find the next page, if there is one. If ``fetch``
|
"""Attempts to find the next page, if there is one. If ``fetch``
|
||||||
is ``True`` (default), returns :class:`HTML <HTML>` object of
|
is ``True`` (default), returns :class:`HTML <HTML>` object of
|
||||||
next page. If ``fetch`` is ``False``, simply returns the next URL.
|
next page. If ``fetch`` is ``False``, simply returns the next URL.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if next_symbol is None:
|
||||||
|
next_symbol = DEFAULT_NEXT_SYMBOL
|
||||||
|
|
||||||
def get_next():
|
def get_next():
|
||||||
candidates = self.find('a', containing=next_symbol)
|
candidates = self.find('a', containing=next_symbol)
|
||||||
|
|||||||
Reference in New Issue
Block a user