Use 'in' instead of == due to charset.

This commit is contained in:
voussoir 2023-09-12 19:03:03 -07:00
parent fa79da3a7b
commit eceed3694e

View file

@ -99,7 +99,7 @@ def linkchecker(do_external=True):
if link not in seen:
queue.append(link)
seen.add(link)
elif result.head.headers['content-type'] == 'text/html' and not url.endswith('.html'):
elif 'text/html' in result.head.headers['content-type'] and not url.endswith('.html'):
log.debug('GET %s', url)
response = session.get(url)
soup = bs4.BeautifulSoup(response.text, 'html.parser')