From eceed3694ec91d3adb02b1d214788f23230768a7 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 12 Sep 2023 19:03:03 -0700 Subject: [PATCH] Use 'in' instead of == due to charset. --- linkchecker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linkchecker.py b/linkchecker.py index 50da3fb..3493552 100644 --- a/linkchecker.py +++ b/linkchecker.py @@ -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')