Skip to content

KaiCodes

Contact

Scrape Reddit Data Daily with Python and AWS Lambda

1 min read

https://www.reddit.com/r/learnpython/comments/eqhs49/automatically_scrape_website/ Determine lambda evocation cost https://github.com/serverless/examples/tree/master/aws-python-scheduled-cron https://serverless.com/blog/serverless-python-packaging/ https://docs.aws.amazon.com/lambda/latest/dg/tutorial-scheduled-events-schedule-expressions.html

This tutorial will show you how to deploy an AWS Lambda function with Serverless Framework that runs a cron job.

Prerequisites

  • You should have Serverless Framework installed and set up with AWS
  • You need some version of Python 3 (3.6, 3.7, or 3.8)

Steps

  1. Create serverless project
  2. Set up venv and get requests
  3. Download JSON file for development
  4. Extract details
  5. Switch to fetching data
  6. Deploy api

Download a subreddit JSON file