Skip to content

Commit 5b07135

Browse files
Skip and atom feed bug
1 parent 815361f commit 5b07135

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

blog2epub/crawlers/crawler.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -651,18 +651,28 @@ def get_comments(self):
651651
for c in comments_in_article:
652652
c = c.strip()
653653
if c not in ("Odpowiedz", "Usuń"):
654-
self.comments = self.comments + "<" + tag + ">" + c + "</" + tag + ">"
654+
self.comments = (
655+
self.comments + "<" + tag + ">" + c + "</" + tag + ">"
656+
)
655657
if tag == "h4":
656658
tag = "p"
657659
if c == "Usuń":
658660
tag = "h4"
659661
else:
660-
authors = self.tree.xpath('//dl[@id="comments-block"]//*[@class="comment-author"]')
661-
comments = self.tree.xpath('//dl[@id="comments-block"]//*[@class="comment-body"]')
662+
authors = self.tree.xpath(
663+
'//dl[@id="comments-block"]//*[@class="comment-author"]'
664+
)
665+
comments = self.tree.xpath(
666+
'//dl[@id="comments-block"]//*[@class="comment-body"]'
667+
)
662668
try:
663669
for x in range(0, len(authors) + 1):
664-
a = "".join(authors[x].xpath('.//text()')).strip().replace("\n", " ")
665-
c = "".join(comments[x].xpath('.//text()')).strip()
670+
a = (
671+
"".join(authors[x].xpath(".//text()"))
672+
.strip()
673+
.replace("\n", " ")
674+
)
675+
c = "".join(comments[x].xpath(".//text()")).strip()
666676
self.comments += f"<h4>{a}</h4>"
667677
self.comments += f"<p>{c}</p>"
668678
except IndexError:

0 commit comments

Comments
 (0)