维基百科 API return 与 HTML 中的内容不同

Wikipedia API doesn't return the same content that is in HTML

我正在尝试从维基百科获取电视剧集列表,但通过 API 返回的剧集列表与通过 HTTP 获取的不匹配。

$ wget -O wiki-html -q "http://en.wikipedia.org/wiki/List_of_Agents_of_S.H.I.E.L.D._episodes"
$ grep 'Laws of Nature' wiki-html
<td class="summary" style="text-align:left">"Laws of Nature"<sup id="cite_ref-futon_52-0" class="reference"><a href="#cite_note-futon-52"><span>[</span>52<span>]</span></a></sup></td>
$ wget -O wiki-api -q "http://en.wikipedia.org/w/api.php?action=query&titles=List_of_Agents_of_S.H.I.E.L.D._episodes&prop=revisions&rvprop=content&format=json"
$ grep 'Laws of Nature' wiki-api
$

您可以看到 "Laws of Nature" 剧集出现在 HTML 版本中,但不出现在 JSON 版本中。似乎没有多次修改,其他节目也没有出现过这个问题。可能是什么问题?

如果您查看 the source code of the article,您会注意到这样的代码:

===Season 3=== <!--Do not add years until episodes have aired, as per WP:TVUPCOMING.-->
{{main|Agents of S.H.I.E.L.D. (season 3)}}
{{:Agents of S.H.I.E.L.D. (season 3)}}
<!-- To edit the episodes in this section, you need to edit the article listed above. -->

这意味着实际内容在文章 Agents of S.H.I.E.L.D. (season 3) 中(特别是剧集部分),并且从那里嵌入。

如果您想要 HTML 内容,请使用 rvparse=1 选项。