How to find the location of a news article (i.e. the news is related to which place) from a news website?

I am making a news app that aggregates news from different news websites. I have successfully made the UI and the scrapping part is also done. But I am unable to get the location of the news article wherefrom the news is based. Suppose, the news is of Masachuttes from the USA Today. So, I need to extract the location - Masachuttes from the news website - USA Today. This is my problem description. So, I need your help in this regard.

I tried the Geo-Location API but it did not work as it only asks for the user permission so it went in vain. As of now, I have no idea how to do it. Expectation is that I could scrape the loation of a particular news article of a news website.

ipinfo.io provide some geodata.
It easy to use if you have the IP address:

import requests
country = requests.get( 'http://ipinfo.io/8.8.8.8/country').text.strip()
city = requests.get( 'http://ipinfo.io/8.8.8.8/city').text.strip()

or you can get the whole enchilada with:

import requests
geodata = requests.get( 'http://ipinfo.io/8.8.8.8/json').text
Back to Top