Ths is a simple web scraper utilizing newspaper3k to scrape news articles and send them via text. Currently, it scrapes 2 sources: Business Daily and Standard media
The Script then sends top 3 headlines with links to the specified mobile_number
in the `.env
This project also uses an .env file to store the API key, username and mobile number Both can be obtained by signing up/logging into Africas Talking An env example is provided for reference.
Clone this repo to a suitable location.
git clone https://github.com/KenMwaura1/daily-news-scraper
OR
Download the zip and extract it.
Change into the directory.
cd daily-news-scraper
Create a virtual environment (venv) to hold all of the required dependecies.Here we use the built-in venv module.
python -m venv env
Activate the virtual environment
source env/bin/activate
Create a virtual environment
python3 -m venv venv
For zsh users
source venv/bin/activate.zsh
For bash users
source venv/bin/activate.bash
For fish users
source venv/bin/activate.fish
Alternatively if you are using pyenv
pyenv virtualenv daily-news-scraper
pyenv activate daily-news-scraper
Install the required dependencies:
pip install -r requirements
Create .env
file and add your credentials as specified.
touch .env
OR
Copy the provided example and edit as required:
cp .env-example env
Run the script
python news_scraper.py