【发布时间】:2013-12-15 16:44:05
【问题描述】:
我正在尝试解析来自 Wikipedia API (MediaWiki) 的响应。我使用的 URL 格式为 -
https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=xml&titles=Argo_(2012_film)
来自 api 的响应在 xml 标记中包含维基百科内容,如下所示:(这只是一个不完整的示例)
{{Use mdy dates|date=October 2012}} {{Infobox film | name = Argo | image =
Argo2012Poster.jpg | alt = <!-- See: WP:ALT --> | caption = Theatrical release poster |
tagline = "The movie was fake. The mission was real." | director = [[Ben Affleck]] |
producer = [[Grant Heslov]]<br />Ben Affleck<br />[[George Clooney]] | based on = {{Based
on|''The Master of Disguise''|[[Tony Mendez|Antonio J. Mendez]]}}<br />{{Based on|''The
Great Escape''|[[Joshuah Bearman]]}} | screenplay = [[Chris Terrio]] | starring = Ben
Affleck<br />[[Bryan Cranston]]<br />[[Alan Arkin]]<br />[[John Goodman]] | music =
[[Alexandre Desplat]] | cinematography = [[Rodrigo Prieto]] | editing = [[William
Goldenberg]] | studio = [[Graham King|GK Films]]<br />[[Smokehouse Pictures]] | distributor =
[[Warner Bros.]] | released = {{Film date|2012|08|31|Telluride Film
Festival|2012|10|12|United States}} | runtime = 120 minutes<ref> ...continued
这看起来不像 JSON 或 XML,我该如何解析?
【问题讨论】:
-
看起来它为您提供了该页面的维基百科代码。在有问题的页面上点击编辑,你会看到......差不多就是这样。
-
是的,你是对的,但无论如何我可以解析这个?
-
你想用这些数据做什么?