mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Fix forum crawling crashing for empty threads
This commit is contained in:
parent
66a5b1ba02
commit
4a51aaa4f5
@ -22,6 +22,9 @@ ambiguous situations.
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Fixed
|
||||
- Forum crawling crashing when parsing empty (= 0 messages) threads
|
||||
|
||||
## 3.4.1 - 2022-08-17
|
||||
|
||||
### Added
|
||||
|
@ -937,6 +937,13 @@ def parse_ilias_forum_export(forum_export: BeautifulSoup) -> List[IliasForumThre
|
||||
for p in forum_export.select("body > p"):
|
||||
title_tag = p
|
||||
content_tag = p.find_next_sibling("ul")
|
||||
|
||||
if not content_tag:
|
||||
# ILIAS allows users to delete the initial post while keeping the thread open
|
||||
# This produces empty threads without *any* content.
|
||||
# I am not sure why you would want this, but ILIAS makes it easy to do.
|
||||
continue
|
||||
|
||||
title = p.find("b").text
|
||||
if ":" in title:
|
||||
title = title[title.find(":") + 1:]
|
||||
|
Loading…
Reference in New Issue
Block a user