Create A Reddit Scraper Without API Key Using Python
ฝัง
- เผยแพร่เมื่อ 10 ก.พ. 2024
- Reddit, a platform where millions of people share their ideas, opinions, and questions about anything. It’s also a data gold mine for data analytics, trend analysis, and market research. In this tutorial, I will show you how to scrape reddit data without using Reddit API access key in Python.
📋 Source Code: / source-code-tw-n-10231...
► Buy Me a Coffee? Your support is much appreciated!
-------------------------------------------------------------------------------------------
☕ Paypal: www.paypal.me/jiejenn/5
☕ Venmo: @Jie-Jenn
💸 Join Robinhood with my link and we'll both get a free stock: bit.ly/3iWr7LC
► Support my channel so I can continue making free contents
---------------------------------------------------------------------------------------------------------------
🛒 By shopping on Amazon → amzn.to/2JkGeMD
👩💻 Follow me on Linked: / jiejenn
🌳 Becoming a Patreon supporter: / jiejenn
✉️ Business Inquiring: TH-cam@LearnDataAnalysis.org
#webscraping #python #reddit
I tried this but getting an error that it is fetching too fast. I did 60 second timer as well. Is there a fix for this?
Show. How to extract comment data from TH-cam without using the API???
is there a way i can save photos from a post?
Let me look into it.
@@jiejenn ive figured it out thanks.
subreddit = await reddit.subreddit("cats")
all = subreddit.search("flair:humor", time_filter="all")
urllist = []
redditors = []
async for submission in all:
if "gif" in str(submission.url) or "jpeg" in submission.url:
urllist.append(submission.url)
from here use PIL and requests to save to your files
@@jiejenn hey did you find any solution?
I have been able to extract posts and comments but not photos.
Nice, how would you get comments?
You will need to figure out the url of the post first, then append /comment.json. For example www.reddit.com/r/CreditCards/comments/1b35tnk/discover_q2_2024_categories/comments
@@jiejenn Thanks!
@@jiejenn hey, with your code i do get an error for comments. How do i have to change the code? Does the url still work like this?