A lightweight Python client to search and retrieve news articles from Google News, returning structured JSON. Current version 0.4.3. Low release cadence, last release in 2021.
pip install gnewsVerified import paths — ran on the pinned version, not inferred.
Basic usage: create a GNEWS instance and call get_news() to retrieve articles.
Update code to handle list directly, not accessing .get('entries').Use `from gnews import GNEWS`.
Use `get_news(query)` with appropriate keywords instead.
Manually set headers on the session: `gnews.session.headers.update({'User-Agent': 'Mozilla/5.0 ...'})`.Use valid country codes. Common ones: 'US', 'GB', 'IN', 'CA'.