私は Python Reddit API Wrapper (PRAW) を使用して、Reddit から特定のコメントを収集してきました。よく使用する機能の 1 つはreplace_more_comments()
、スレッドのすべてのコメントを収集することです。
これらのスレッドの一部は非常に大きく (たとえば 10,000 コメント)、すべてのコメントを収集するのに時間がかかります。の進行状況バーを表示する方法はありreplace_more_comments()
ますか?
最小限の作業コード サンプルを次に示します。
import praw
r = praw.Reddit('MSU vs Nebraska game')
submission = r.get_submission(submission_id='3rxx3y')
flat_comments = praw.helpers.flatten_tree(submission.comments)
submission.replace_more_comments(limit=None, threshold=0)
all_comments = submission.comments
flat_comments = praw.helpers.flatten_tree(submission.comments)