使用维基百科解疑

编程入门 行业动态 更新时间:2024-10-26 16:26:52
本文介绍了使用维基百科解疑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图用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.

更多推荐

使用维基百科解疑

本文发布于:2023-06-07 17:34:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/589309.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:维基百科

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!