commit 80c1d7455156e80da6aa7ab4c394c55a9cc3e4b8
parent df51579bbeaf2463078a574b4f59130c322fc05e
Author: Isak Lindhé <isak.e.lindhe@gmail.com>
Date: Sat, 26 Jan 2019 10:22:48 +0100
fixed parsing bug on missing class attr
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/listing.py b/src/listing.py
@@ -34,7 +34,7 @@ def parse_content_listing(page: bs4.element.Tag) -> list:
raw += n
pass
elif isinstance(n, bs4.element.Tag):
- if all((x not in n.attrs['class']) for x in ['bgB', 'bgY', 'Y']):
+ if 'class' not in n.attrs or all((x not in n.attrs['class']) for x in ['bgB', 'bgY', 'Y']):
raw += n.get_text()
entries = raw.splitlines()
entries = [e for e in entries if not re.fullmatch(' *', e)]