Questions tagged [praw]

PRAW (Python Reddit API Wrapper) is a python package used to access and interact with the reddit API.

PRAW, short for Python Reddit API Wrapper, is a python package that allows for simple access to ’s API. PRAW aims to be as easy to use as possible and is designed to follow all of reddit’s API rules. You have to give a useragent that follows the rules, everything else is handled by PRAW so you needn’t worry about violating them.

617 questions
-1
votes
2 answers

instead of returning an image praw returns r/memes/hot

I want my discord.py bot to send a meme from hot posts of r/memes via PRAW. After this issue, I tried searching in the web and in the documentations, but I didn't find any method to view the image. Here is my code: import praw import discord from…
Fghjkgcfxx56u
  • 99
  • 1
  • 11
-1
votes
1 answer

I scraped data using the Reddit API praw in Python, but characters like ' show up as ’t. How do I fix this?

I'm very new to Python (And StackOverflow, so excuse me if I'm doing this wrong). i scraped submissions from the /r/loseit subreddit, so I could clean it and make a wordcloud in R for an assignment. The scraping went fine, however special characters…
Emmy
  • 13
  • 2
-1
votes
2 answers

How do I download YouTube videos in a for loop (for every link) with pytube?

So I have a for loop with a lot of YouTube links, and I want to download them in that loop. There is an error that says 'Unavailable Video' when I do this: for post in hot_posts: yt = YouTube(post.url) yt.download() So let me explain this…
snocc
  • 19
  • 4
-1
votes
1 answer

Appending PRAW results from multiple subreddits to one dataframe

I'm currently using PRAW right now to grab the results from multiple different subreddits and trying to group every single result from each subreddit into one dataframe. Right now it works perfectly fine with one subreddit, however once I pass in a…
Sebastian Goslin
  • 477
  • 1
  • 3
  • 22
-1
votes
2 answers

Getting the URLs of image posts on Reddit

I'm working on a reddit bot that's purpose is to find reposts when it detects a comment containing "!repostfinder". The bot is able to detect the string, but I don't know how to get the image that was commented on. Here's the code I have so…
user10463939
-1
votes
1 answer

"TypeError: 'str' object is not callable" when using praw permalink()

I want to use praw to get the link of a reddit post in the sub r/DJBluntztestzone. Here is the code I am having trouble with: for post in reddit.subreddit('DJBluntztestzone').top('all'): link = post.permalink() print(link) I am getting…
Nat
  • 55
  • 1
  • 10
-1
votes
1 answer

I want to set flair to my reddit post using PRAW, can someone suggest solution to it?

I'm learning PRAW API to create bot to autopost things on my subreddit and script it working fine except flair setting. I tried to use this line to set flair: reddit.subreddit(sub_reddit).flair.set('bboe', 'bahissiteleri flair') from praw API…
GigaByte
  • 700
  • 6
  • 21
-1
votes
1 answer

How to compare a date to a time in python?

I'm making a bot for /r/MemeEconomy and was wanting to get how old the post is and see if its older than 25 seconds (for testing purposes). for submission in subreddit.new(limit=10): submissiontime =…
-1
votes
2 answers

PRAW: Python can print Reddit comment variable but not return it

I've read this answer, a second answer and also this answer about mixing return with loops and lastly this answer about returns, but they don't apply here. Problem: I can print the date of comment, but I can't seem to "return" it properly.…
angsty_robot
  • 305
  • 2
  • 6
  • 13
-1
votes
1 answer

python praw get comment and write in file format

I'm getting a subreddit's contents. The subreddit is AR. I need to get post ID, title, post content, author, post date, score, comments, and comment ID, then write into txt file. The problems I'm facing now are: (1) Can I combine comments and…
Michael Lin
  • 105
  • 1
  • 12
-1
votes
2 answers

Neatly Print Comments Through Python Reddit API

I am trying to do some text analysis with Reddit comments. The script I have currently prints out the body and upvote count all comments on a given subreddit's "hot" posts with more than 5 upvotes: import praw reddit = praw.Reddit(client_id=ID, …
Dynamic
  • 921
  • 1
  • 12
  • 31
-1
votes
1 answer

How do I exclude sticky submissions using PRAW?

I'm trying to get the top submission from a subreddit which is not sticky. Tried something like this: reddit = praw.Reddit(client_id='xx', client_secret='yy', user_agent='zz') submissions = reddit.subreddit('theSubreddit').hot(limit=1,…
aniskhan001
  • 7,981
  • 8
  • 36
  • 57
-1
votes
2 answers

Why won't my python program print the list?

import praw import time from selenium import webdriver driver = webdriver.Chrome() r = praw.Reddit(client_id='XXXXXXXXXX', client_secret='XXXXXXXXXXXXX', password='XXXXXXXXX', user_agent='Grand Street…
-1
votes
1 answer

How to solve Python praw error : AttributeError: 'module' object has no attribute 'objects'

Here is code - I try google but did not find solution :( #!/usr/bin/env python3 import praw …
supersonic
  • 29
  • 3
-1
votes
1 answer

Unable to download praw using pip

I'm currently working my way through this guide which details how to make a reddit bot. followed the first step and ran my code in Python IDLE but had an issue because I didn't have PRAW downloaded. My question is how exactly do I download PRAW? I…
jmecs
  • 143
  • 2
  • 13