Fix crawling of cards without descriptions

This commit is contained in:
I-Al-Istannen 2023-03-21 23:52:33 +01:00
parent 467fc526e8
commit 6f30c6583d
2 changed files with 6 additions and 1 deletions

View File

@ -25,6 +25,7 @@ ambiguous situations.
### Fixed ### Fixed
- Crawling of courses with the timeline view as the default tab - Crawling of courses with the timeline view as the default tab
- Crawling of file and custom opencast cards - Crawling of file and custom opencast cards
- Crawling of button cards without descriptions
## 3.4.3 - 2022-11-29 ## 3.4.3 - 2022-11-29

View File

@ -708,7 +708,11 @@ class IliasPage:
"div", "div",
attrs={"class": lambda x: x and "caption" in x}, attrs={"class": lambda x: x and "caption" in x},
) )
description = caption_parent.find_next_sibling("div").getText().strip() caption_container = caption_parent.find_next_sibling("div")
if caption_container:
description = caption_container.getText().strip()
else:
description = None
if not type: if not type:
_unexpected_html_warning() _unexpected_html_warning()