Fix AttributeError

This commit is contained in:
vas3k
2020-01-26 16:10:57 +01:00
parent 06edc0a7d9
commit f62602e60f

View File

@@ -253,7 +253,10 @@ def parse_image(entry):
def parse_text_and_image(entry):
bs = BeautifulSoup(entry.summary, features="lxml")
if not entry.get("summary"):
return "", ""
bs = BeautifulSoup(entry["summary"], features="lxml")
text = re.sub(r"\s\s+", " ", bs.text or "").strip()
img_tags = bs.findAll("img")