0

我不知道如何让他们工作。根据官方 API 文档:

http://www.mediawiki.org/wiki/API:Query#Resolving_redirects

这意味着以下请求:

http://en.wikipedia.org/w/api.php?action=query&titles=Hybrid%20Cars&prop=info|links&redirects

将解析 Hybrid Cars 并重定向到 Hybrid Vehicles 页面,但它没有。即,我期望类似:

http://en.wikipedia.org/w/api.php?action=query&titles=Hybrid%20Vehicles&prop=info|links

4

1 回答 1

3

The page Hybrid Cars does not exist, so the result you're getting (with the missing attribute) is correct. You probably meant Hybrid cars, which is a redirect to Hybrid vehicle. Page names on Wikipedia are case sensitive except for the first letter.

If you use the correct capitalization, you will get the correct results:

http://en.wikipedia.org/w/api.php?action=query&titles=Hybrid%20cars&prop=info|links&redirects

于 2013-07-08T19:38:19.353 回答