我如何使用Wikipedia API
I want try to get tennis players description from wikipedia without scratch the DOM page on a player x. It's not allowed and very boring. So, I hope someone can reply to my only question.
我想尝试从wikipedia获得网球运动员的描述,而不是划痕玩家x上的DOM页面。这是不允许的,也很无聊。所以,我希望有人可以回复我唯一的问题。
What can I do precisly with the Wikipedia API ? Can I get informations about a collection of tennis players easily ? or this API is not working for this. If not, I need someone tells me what is the purpose of this API because I don't understand the documentation.
我可以准确地使用维基百科API做什么?我可以轻松获得有关网球运动员的信息吗?或者这个API不起作用。如果没有,我需要有人告诉我这个API的目的是什么,因为我不懂文档。
2 个解决方案
#1
2
Take a look at the Wikipedia API Sandbox - with that you can play around and try to get the info you need.
看看维基百科API沙盒 - 你可以玩,并尝试获取所需的信息。
To get the info from a page, you can use the parse action.
要从页面获取信息,您可以使用解析操作。
Trying to get the information for the danish tennisplayer Caroline Wozniacki, I used the parse action along with the json format.
In the field labeled page I pasted Caroline_Wozniacki
and I pressed Make Request.
为了获得丹麦网球运动员Caroline Wozniacki的信息,我使用了解析动作和json格式。在标记页面的字段中,我粘贴了Caroline_Wozniacki并按下了Make Request。
This gives me this URL: http://en.wikipedia.org/w/api.php?action=parse&format=json&page=Caroline_Wozniacki
This contains the page with links, references and all in JSON format.
这给了我这个URL:http://en.wikipedia.org/w/api.php?action =arse&format = json&page = Caroline_Wozniacki这包含带有链接,引用和所有JSON格式的页面。
更多相关文章
- 刷新php页面而不重载内容?
- 如何通过PHP将HTML页面作为字符串获取?
- thinkphp执行删除操作然后成功success后页面跳转失败问题
- 在通过AJAX响应发送的页面上执行javascript函数
- 使用jQuery和ajax更改浏览器地址栏URL,无需重载页面[重复]
- 阅读使用JavaScript生成的页面
- PHP教程之PHP调用session_start后页面始终加载的问题研究
- jQuery ajax调用不会调用我的php页面
- 使用安全的会话-cookie在HTTP和HTTPS页面之间切换