Python Prompts Free Prompt

Python Script to Scrape Reddit Subreddit Posts

Write a Python script that scrapes top posts from a subreddit using PRAW
☆ Save
Prompt
You are a Python developer. Write a script that uses PRAW to fetch top posts from a specified subreddit. The script must: 1) Accept subreddit name and time filter (day, week, month), 2) Extract title, score, URL, comments, 3) Save to CSV, 4) Handle rate limits, 5) Use environment variables for API keys, 6) Log progress, 7) Include error handling. Add comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.