"Scrape" ALL latest news on any company/person within 3 lines of Python code
Mining news data from Google
Step 1. Install pygooglenews
$ pip install pygooglenews
Step 2. Three lines to get news data
from pygooglenews import GoogleNews
gn = GoogleNews(lang = 'en', country = 'US')
# latest news on Amazon that got published over the last hour
news = gn.search('Amazon', when = '1h')
Why is it cool?
You get data from Google — the best search engine
pygooglenews
hits RSS feed URL (not the UI URL). So, you not get blocked by scraping GoogleGoogle’s RSS can have up to 100 articles. But, Google allows you to specify that you want to see only the articles from the past hour.
Make such a request a few times an hour, and you will not miss a single news article that mentions your company/person of interest.
(Unless there were significantly more than 100 articles indexed by Google about it within the past hour)
Other reads that you might find interesting: