MCPcopy
hub / github.com/DedSecInside/TorBot / parse_links

Function parse_links

torbot/modules/linktree.py:151–157  ·  view source on GitHub ↗

Finds all anchor tags and parses the href attribute.

(html: str)

Source from the content-addressed store, hash-verified

149
150
151def parse_links(html: str) -> list[str]:
152 """
153 Finds all anchor tags and parses the href attribute.
154 """
155 soup = BeautifulSoup(html, 'html.parser')
156 tags = soup.find_all('a')
157 return [tag['href'] for tag in tags if tag.has_attr('href') and validators.url(tag['href'])]
158
159
160def parse_emails(soup: BeautifulSoup) -> list[str]:

Callers 1

_build_treeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected