Define the environment
First, we’ll define our environment. For this project. we’ll need the following libraries:app.py
Starting the environment
Spin up the environment by runningbeam start <your app>.py
You’ll see the red
beam text at the end of your shell path, which means you’ve entered the Beam
environment!
Write scraping logic
Now, we’ll write logic to scrape the headlines from The New York Times. Create a new file - let’s call itscraper.py
.
scraper.py
Running the scraper
Now, we’re ready to run our code using Beam. In your terminal, run: