Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

6
Why can't I chain `hot()` with `search()`?
Post Flair (click to view more posts with a particular flair)
Post Body

I try to have a chain like this:

reddit.subreddit("all").hot(limit=50).search("praw")

But it returns AttributeError: 'ListingGenerator' object has no attribute 'search'

Similarly, chaining

reddit.subreddit("all").search("praw").hot(limit=50)

gives AttributeError: 'ListingGenerator' object has no attribute 'hot'

Do you know why is that?

Full code

import praw
import pandas as pd
import numpy as np
from datetime import datetime

# create a reddit connection
reddit = praw.Reddit(
    client_id="abc",
    client_secret="xyz", 
    user_agent="test"
)

i = 1
for submission in reddit.subreddit("all").hot(limit=50).search("praw"):
    print(i, " ", submission.title)
    i =1

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
9,444
Link Karma
7,072
Comment Karma
2,293
Profile updated: 4 days ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago