Replace soup.select with soup.find(id).
This commit is contained in:
parent
e843770f3c
commit
3ec799302d
1 changed files with 1 additions and 1 deletions
|
@ -104,7 +104,7 @@ def linkchecker(do_external=True):
|
||||||
response = session.get(url)
|
response = session.get(url)
|
||||||
soup = bs4.BeautifulSoup(response.text, 'html.parser')
|
soup = bs4.BeautifulSoup(response.text, 'html.parser')
|
||||||
if result.url_parts.fragment:
|
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}')
|
result.exc = BrokenAnchor(f'Broken anchor: #{result.url_parts.fragment}')
|
||||||
links = extract_links(url, soup)
|
links = extract_links(url, soup)
|
||||||
for link in links:
|
for link in links:
|
||||||
|
|
Loading…
Reference in a new issue