我试图用wikipedi的歧义页面做一些歧义。我得到的使用查询从消歧页面链接列表
en.wikipedia/w/api.php?action=query&prop=links&format=json&titles=stack%20overflow_(disambiguation)我得到的链接好了,但什么是让旁边显示每个链接的文本最快的方法是什么? API不让它一应俱全。我的code的其他部分都在做不可避免地耗费时间的工作,想知道是否有人能提出一些快速的黑客...
解决方案有没有办法从链接列表转到旁边的文字链接通过API。最迅速(可能只)的办法就是下载页面wikitext的或HTML和解析。
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
en.wikipedia/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 ...
解决方案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.
更多推荐
使用维基百科解疑
发布评论