问题
I want to get the coordinates of a Wikipedia page through their API. I want to put the page title as 'titles' parameter. I have searched SO for a solution but seems they are scrapping the page then extracting. Is it possible through their API?
回答1:
You need to use Wikipedia API. For your example with Kinkaku-ji the query will be:
https://en.wikipedia.org/w/api.php?action=query&prop=coordinates&titles=Kinkaku-ji
For more than one title use pipe to separate them: titles=Kinkaku-ji|Paris|...
来源:https://stackoverflow.com/questions/40098656/how-to-get-coordinates-from-a-wikipedia-page-through-api