Ryuno-Ki/webmention-tools

minor noop BeautifulSoup usage tweak

Ryuno-Ki opened this issue · 1 comments

See snarfed@6170b4d

I'd rather spend another minute trying to understand the original implementation before changing it.

Closing.

Adopted the implementation in

soup = BeautifulSoup(html, "html.parser")
links_and_anchors = soup.find_all(["link", "a"])
webmentions = []
for link_or_anchor in links_and_anchors:
if link_or_anchor.attrs.get("rel"):
if "webmention" in link_or_anchor.attrs.get("rel"):
href = link_or_anchor.attrs.get("href")
if href is not None:
webmention_link = _ensure_url(target_url, href)
webmentions.append(webmention_link)