news-fetch is an open-source, easy-to-use news crawler that extracts structured information from almost any news website π. It can recursively follow internal hyperlinks and read RSS feeds to fetch both recent and archived articles π. You only need to provide the root URL of the news website to crawl it completely π. News-fetch combines the power of multiple state-of-the-art libraries and tools.
I built this tool to minimize NaN or empty values when scraping data from various news websites π. It's platform-independent and written in Python 3, making it easy for programmers and developers to access news data for their applications π».
news-fetch extracts the following attributes from news articles. You can also check out an example JSON file generated by news-please.
- π° Headline
- βοΈ Author(s)
- π Publication date
- ποΈ Publication
- π Category
- π Source domain
- π Article content
- π Summary
- π Keywords
- π URL
- π Language
Use the package manager pip to install the required dependencies:
pip install -r requirements.txtYou can download it by clicking the green download button.
To scrape all the news details, use the newspaper function:
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
Make sure to update tests as appropriate.