A simple web scraper that collects news articles from three Bahamian news websites:
- Our News
- ZNS Bahamas
- Eyewitness News
- Python 3.x
- Internet connection
-
Download the Files
- Save these three files in the same folder:
web_scraper.py
check_dependencies.py
README.md
- Save these three files in the same folder:
-
Install Required Packages
- Open your terminal/command prompt
- Navigate to the folder containing the files
- Run this command to install required packages:
python check_dependencies.py
-
Run the Scraper
- Open your terminal/command prompt
- Navigate to the folder containing the files
- Run this command:
python web_scraper.py
-
Enter the Date
- When prompted, enter a date in this format: YYYY-MM-DD
- Example: 2024-01-15
-
View Results
- The program will create a CSV file named
news_articles_YYYY-MM-DD.csv
- You can open this file with Excel or any spreadsheet program
- The results will show:
- Source (which news website)
- Article title
- Article link
- The program will create a CSV file named
The program will show you:
- How many articles it found from each news source
- The total number of articles
- Where it saved the results
If you get any errors:
- Make sure you have Python installed
- Check your internet connection
- Verify you entered the date in the correct format (YYYY-MM-DD)
- Try running
check_dependencies.py
again
If you're having problems:
- Make sure all files are in the same folder
- Check that you're typing the commands exactly as shown
- Verify your internet connection is working