您正在下载JSON数据而不解码。使用^{} library来实现:import json
articleContent = ClientCookie.urlopen(url)
data = json.load(articleContent)
JSON编码的数据看起来很像Python,它也使用\u转义,但实际上它是JavaScript的一个子集。在
data变量现在拥有一个深层的数据结构。从线的分裂来看,你想要的是:
^{pr2}$
现在articleContent是一个实际的unicode()实例;它是您要查找的页面的修订文本:>>> print u'\n'.join(data['query']['pages'].values()[0]['revisions'][0]['*'].splitlines()[:20])
{{For|the game|100 Bullets (video game)}}
{{GOCEeffort}}
{{italic title}}
{{Supercbbox
| title =100 Bullets
| image =100Bullets vol1.jpg
| caption = Cover to ''100 Bullets'' vol. 1 "First Shot, Last Call". Cover art by Dave Johnson.
| schedule = Monthly
| format =
|complete=y
|Crime = y
| publisher = [[Vertigo (DC Comics)|Vertigo]]
| date = August [[1999 in comics|1999]] – April [[2009 in comics|2009]]
| issues = 100
| main_char_team = [[Agent Graves]]
[[Mr. Shepherd]]
The Minutemen
[[List of characters in 100 Bullets#Dizzy Cordova (also known as "The Girl")|Dizzy Cordova]]
[[List of characters in 100 Bullets#Loop Hughes (also known as "The Boy")|Loop Hughes]]
| writers = [[Brian Azzarello]]
| artists = [[Eduardo Risso]]
Dave Johnson
| pencillers =
| inkers =
| colorists = Grant Goleash
[[Patricia Mulvihill]]