This script scrapes the top movies from IMDb and stores the data in a CSV file.
-
Create a virtual environment called
.env
:python -m venv .env
-
Activate the virtual environment:
- Linux/macOS:
source .env/bin/activate
- Windows:
.env\Scripts\activate
- Linux/macOS:
-
Install the required libraries:
pip install -r requirements.txt
To run the script, execute the following command:
python main.py
The script will store the data in a CSV file named top_movies.csv
in the same directory.
To run the tests in the tests
directory, execute the following command:
pytest
Make sure the virtual environment is activated beforehand. You can run this command in the root directory.