Simple repo which gathers news aricles from the web. The service uses the Google RSS News Feed to search for news articles by keyword, then scrapes the articles from the returned links.
Use the parameters.py file to specify:
WEBSITES: a list of websites to gather articles from.QUERIES: a list of terms which mush be contained in the articlesSTART_DATE: the earliest the articles are published (inclusive)END_DATE: the latest the articles are published (exclusive)DAYS_PER_QUERY: the number of days off links to gather per query to Google RSSMIN_DELAY: the min seconds to wait between queriesMAX_DELAY: the max seconds to wait between queries
- Install all requirements from requirements.txt
- Edit
parameters.pyas you like - Run
scrape_news_articles.py
All data is saved in CSV in the ./data folder. Note that in order to avoid being blocked by either Google RSS Feed or the news site itself, there is a delay between queries of 5 to 8 seconds by default. You may want to let this service run overnight, or change the delay time between queries.