From 3ec799302df4c2faa5266daa206549f1f43a1ba3 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 15 Oct 2022 22:35:37 -0700 Subject: [PATCH] Replace soup.select with soup.find(id). --- linkchecker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linkchecker.py b/linkchecker.py index 80a42b7..50da3fb 100644 --- a/linkchecker.py +++ b/linkchecker.py @@ -104,7 +104,7 @@ def linkchecker(do_external=True): response = session.get(url) soup = bs4.BeautifulSoup(response.text, 'html.parser') if result.url_parts.fragment: - if not soup.select(f'#{result.url_parts.fragment}'): + if not soup.find(id=result.url_parts.fragment): result.exc = BrokenAnchor(f'Broken anchor: #{result.url_parts.fragment}') links = extract_links(url, soup) for link in links: