errar
This commit is contained in:
parent
393e01d7e9
commit
4ff8c37160
1 changed files with 2 additions and 2 deletions
|
@ -34,7 +34,7 @@ class Node(Clonable):
|
||||||
|
|
||||||
def from_path(path: str) -> Self:
|
def from_path(path: str) -> Self:
|
||||||
with open(path, "r") as f:
|
with open(path, "r") as f:
|
||||||
return Node(BeautifulSoup(f.read(), 'html.parser'))
|
return Node(BeautifulSoup(f.read(), 'html.parser').find())
|
||||||
|
|
||||||
def from_element(element: "Parsable") -> Self:
|
def from_element(element: "Parsable") -> Self:
|
||||||
if isinstance(element, Node):
|
if isinstance(element, Node):
|
||||||
|
@ -94,7 +94,7 @@ class Template(Clonable):
|
||||||
|
|
||||||
def from_path(path: str) -> Self:
|
def from_path(path: str) -> Self:
|
||||||
with open(path, "r") as f:
|
with open(path, "r") as f:
|
||||||
return Template(BeautifulSoup(f.read(), 'html.parser'))
|
return Template(BeautifulSoup(f.read(), 'html.parser').find())
|
||||||
|
|
||||||
def from_element(element: "Parsable") -> Self:
|
def from_element(element: "Parsable") -> Self:
|
||||||
if isinstance(element, Template):
|
if isinstance(element, Template):
|
||||||
|
|
Loading…
Add table
Reference in a new issue