disambiguation using wikipedia

主宰稳场 提交于 2019-12-11 23:41:38

问题


I'm trying to do some disambiguation using wikipedi's disambiguation pages. I get the list of links from the disambiguation page using the query

http://en.wikipedia.org/w/api.php?action=query&prop=links&format=json&titles=stack%20overflow_(disambiguation)

I get the links alright, but what's the speediest way to get the text that appears next to each link? The api doesn't make it readily available. Other parts of my code are doing unavoidably time consuming work, was wondering if anybody could suggest some quick hack ...


回答1:


There is no way to go from "list of links" to "text next to the link" via the API. The speediest (and probably only) way is to download the page wikitext or HTML and parse that.



来源:https://stackoverflow.com/questions/5859082/disambiguation-using-wikipedia

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!