嗨,我有如下回复
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<person>
<first-name>hede</first-name>
<last-name>hodo</last-name>
<headline>Python Developer at hede</headline>
<site-standard-profile-request>
<url>http://www.linkedin.com/profile/view?id=hede&authType=godasd*</url>
</site-standard-profile-request>
</person>
我想解析从linkedin api返回的内容。
我正在使用如下所示的美丽汤
ipdb> hede = BeautifulSoup(response.content)
ipdb> hede.person.headline
<headline>Python Developer at hede</headline>
但是当我这样做时
ipdb> hede.person.first-name
*** NameError: name 'name' is not defined
有任何想法吗 ?