我从这里得到ParseError: not well-formed (invalid token)
:
url = '%s' % steamFriend['profileurl']
tree = ET.fromstring(urllib2.urlopen(url).read())
更多信息:
该网站为http://steamcommunity.com/profiles/76561198152260508?xml=1,这是它的XML树:
<profile>
<steamID64>76561198152260508</steamID64>
<steamID>
<![CDATA[ H@!nE ]]>
</steamID>
<onlineState>offline</onlineState>
<stateMessage>
<![CDATA[ Last Online: ]]>
</stateMessage>
<privacyState>private</privacyState>
<visibilityState>1</visibilityState>
<avatarIcon>
<![CDATA[
http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/be/be7cf633afe1094e4b8dd834321af369a4a37d10.jpg
]]>
</avatarIcon>
<avatarMedium>
<![CDATA[
http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/be/be7cf633afe1094e4b8dd834321af369a4a37d10_medium.jpg
]]>
</avatarMedium>
<avatarFull>
<![CDATA[
http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/be/be7cf633afe1094e4b8dd834321af369a4a37d10_full.jpg
]]>
</avatarFull>
<vacBanned>0</vacBanned>
<tradeBanState>None</tradeBanState>
<isLimitedAccount>1</isLimitedAccount>
</profile>
任何人都可以解释错误是什么以及如何修复它?对不起,我对python来说比较新,我真的很困惑为什么我的代码没有工作。