Skip to content

Commit c28763c

Browse files
committed
Fixing error with deleted accounts
1 parent bf8aee9 commit c28763c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

minet/reddit/scraper.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@ def get_comments(self, url: str, all):
249249
points = None
250250
else:
251251
comment_url = com.scrape_one("a[class='bylink']", "href")
252-
author = com.scrape_one("a[class^='author']")
252+
try_author = com.select_one("div.entry.unvoted")
253+
author = try_author.scrape_one("a[class^='author']")
254+
if not author:
255+
author = "[Deleted]"
253256
points = get_points(com)
254257
published_date, edited_date = get_dates(com)
255258
if "morerecursion" in com.get("class") and all:

0 commit comments

Comments
 (0)