At this point, we've got basically all we could need for historical parsing, but what about for live applications? Maybe you want to keep a database up to da. Python reddit experiments Python BSD-3-Clause 1 2 1 0 Updated Mar 16, 2021. Dispatch Forked from Netflix/dispatch All of the ad-hoc things you're doing to manage incidents today, done for you, and much more! Python Apache-2.0 240 0 0 0 Updated Mar 15, 2021. Rollingpin fast deploy to lots of servers.
- Getting Reddit and subreddit instances PRAW stands for Python Reddit API Wrapper, so it makes it very easy for us to access Reddit data. First we connect to Reddit by calling the praw.Reddit function and storing it in a variable. I'm calling mine reddit.
- Run the script with python reddit.py. It will prompt you to: Specify an filename for your CSV output; To list one or several search terms (comma delimited) To specify your sorting method (relevance, hot, top, new, or comments) Whether you'd like to examine all of reddit (yes or no question), or isolate to one or more subreddits (comma.
According to Alexa [1] people spent more time on Reddit than on Facebook, Instagramm or Youtube. Users use Reddit to post questions, share content or ideas and discuss topics. So it is very interesting to extract automatically text data from this web service. We will look how to do this with PRAW – The Python Reddit API Wrapper.[2]
Python Reddit Scraper
The example of how to get API key and use python PRAW API can be found at How to scrape reddit with python It is however is not adding all comments, that might be attached to submission. Comments can have important information so I decided to build the python script with PRAW API that is modified from above link for adding comments and few minor things.
Python Reddit Scraper
The example of how to get API key and use python PRAW API can be found at How to scrape reddit with python It is however is not adding all comments, that might be attached to submission. Comments can have important information so I decided to build the python script with PRAW API that is modified from above link for adding comments and few minor things.
Reddit Python Api
To get comments we first need to obtain a submission object.
With a submission object we can then like below:
If we wanted to output only the body of the top level comments in the thread we could do:
Here is the full python script of API example that can get Reddit information including comments. Note that as we only downloading data and not changing anything, we do not need user name and password. But in case you modifying data on reddit, you would need include login information too.
Reddit Python Docs
References
1. The top 500 sites on the web
2. PRAW
3. How to scrape reddit with python
4. Tutorials
5. Webscraping Reddit — Python Reddit API Wrapper (PRAW) Tutorial for Windows