reddit

How to scrape posts from a subreddit from a specific year?

How to scrape posts from a subreddit from a specific year? Question: I’m trying to retrieve all the posts from a subreddit that were created in 2020. Below is the code I wrote to try to solve this import praw import pandas as pd import datetime subreddit = reddit_read_only.subreddit("SuicideWatch") # Scraping the top posts of …

Total answers: 1

How to scrape all the posts from a subreddit from a specific period of time?

How to scrape all the posts from a subreddit from a specific period of time? Question: I’m trying to retrieve all the posts from a subreddit that were created in 2020-2021. Below is the code I wrote to try to solve this import datetime subreddit = reddit_read_only.subreddit("SuicideWatch") # Scraping the top posts of all time …

Total answers: 2

How to get total number of posts of a subreddit using Python?

How to get total number of posts of a subreddit using Python? Question: I am working on a project where I have to scrap subreddit using PRAW. But I have to put limit so that it will scrap only that many posts. For example, if I want to scrap a subreddit gaming (https://www.reddit.com/r/gaming/) I have …

Total answers: 2

Reddit API not giving the correct number of search results

Reddit API not giving the correct number of search results Question: I’m trying to search for subreddits associated with a keyword by using the Reddit API but I’m having trouble trying to get 50 or more results. I’ve used the API with the requests library and now with praw and both had the same issue. …

Total answers: 1

Reddit is not callable PRAW Discord.Py

Reddit is not callable PRAW Discord.Py Question: When I try to run my script that collacts memes from reddit, I get this error: Traceback (most recent call last): File “C:UsersemirsPycharmProjectsdiscordmasterbotvenvlibsite-packagesdiscordextcommandsbot.py”, line 892, in invoke await ctx.command.invoke(ctx) File “C:UsersemirsPycharmProjectsdiscordmasterbotvenvlibsite-packagesdiscordextcommandscore.py”, line 797, in invoke await injected(*ctx.args, **ctx.kwargs) File “C:UsersemirsPycharmProjectsdiscordmasterbotvenvlibsite-packagesdiscordextcommandscore.py”, line 92, in wrapped raise CommandInvokeError(exc) from exc …

Total answers: 2

How to keep a program running if there is an Traceback error

How to keep a program running if there is an Traceback error Question: I made a simple script for amusment that takes the latest comment from http://www.reddit.com/r/random/comments.json?limit=1 and speaks through espeak. I ran into a problem however. If Reddit fails to give me the json data, which it commonly does, the script stops and gives …

Total answers: 1