-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added findtext and xpath #47
Changes from 5 commits
31b0ec3
4a4c76e
8632479
76e546f
38543c9
ed2cd1b
423234f
a5b5443
b596b7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,12 @@ from .._types import ( | |
_AttrName, | ||
_AttrVal, | ||
_ElemPathArg, | ||
_NonDefaultNSMapArg, | ||
_NSMapArg, | ||
_TagName, | ||
_TagSelector, | ||
_XPathExtFuncArg, | ||
_XPathVarArg, | ||
) | ||
from ..cssselect import _CSSTransArg | ||
from ._form import FormElement, LabelElement | ||
|
@@ -195,18 +198,33 @@ class HtmlElement(etree.ElementBase): | |
def find( | ||
self, path: _ElemPathArg, namespaces: _NSMapArg | None = None | ||
) -> HtmlElement | None: ... | ||
def findtext( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [mypy] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [pyright] reported by reviewdog 🐶 |
||
self, | ||
path: _ElemPathArg, | ||
default: _T, | ||
namespaces: _NSMapArg | None = None, | ||
) -> str | _T: ... | ||
def findall( | ||
self, path: _ElemPathArg, namespaces: _NSMapArg | None = None | ||
) -> list[HtmlElement]: ... | ||
def iterfind( | ||
self, path: _ElemPathArg, namespaces: _NSMapArg | None = None | ||
) -> Iterator[HtmlElement]: ... | ||
def xpath( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [mypy] reported by reviewdog 🐶 |
||
self, | ||
_path: _AnyStr, | ||
*, | ||
namespaces: _NonDefaultNSMapArg | None = None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [mypy] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [pyright] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [pyright] reported by reviewdog 🐶 |
||
extensions: _XPathExtFuncArg | None = None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [mypy] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [pyright] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [pyright] reported by reviewdog 🐶 |
||
smart_strings: bool = True, | ||
**_variables: _XPathVarArg | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [mypy] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [pyright] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [pyright] reported by reviewdog 🐶 |
||
) -> list[HtmlElement]: ... | ||
def cssselect( | ||
self, | ||
expr: str, | ||
*, | ||
translator: _CSSTransArg = "xml", | ||
) -> list[HtmlElement]: ... | ||
) -> _XPathObject: ... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [mypy] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [pyright] reported by reviewdog 🐶 |
||
|
||
# | ||
# HTML element class attribute | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [pyright] reported by reviewdog 🐶
Method "findtext" overrides class "_Element" in an incompatible manner
Parameter "namespaces" is missing in override
Return type mismatch: base method returns type "str | None", override returns type "str | _T@findtext" (reportIncompatibleMethodOverride)