mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-27 14:25:20 +02:00
recover
This commit is contained in:
parent
857085e859
commit
27e8fdf320
1 changed files with 2 additions and 2 deletions
|
|
@ -43,11 +43,11 @@ class WebPage(BaseModel):
|
|||
soup = _get_soup(self.html)
|
||||
keep_attrs = ["class", "id"]
|
||||
if keep_links:
|
||||
keep_attrs.extend(["href", "title"])
|
||||
keep_attrs.append("href")
|
||||
|
||||
for i in soup.find_all(True):
|
||||
for name in list(i.attrs):
|
||||
if i[name] and name not in keep_attrs and not name.startswith("data-"):
|
||||
if i[name] and name not in keep_attrs:
|
||||
del i[name]
|
||||
|
||||
for i in soup.find_all(["svg", "img", "video", "audio"]):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue