パースをしています。説明タグ内の画像を取得したい。私は urllib と BeautifulSoup を使用しています。別のタグ内にある画像を取得できますが、説明タグ内の画像をエンコードされた形式で取得できません。
XML コード
<item>
<title>Kidnapped NDC member and political activist tells his story</title>
<link>http://www.yementimes.com/en/1724/news/3065</link>
<description><img src="http://www.yementimes.com/images/thumbnails/cms-thumb-000003081.jpg" border="0" align="left" hspace="5" />
‘I kept telling them that they would never break me and that the change we demanded in 2011 would come whether they wanted it or not’
<br clear="all"></description>
ビュー.py
for q in b.findAll('item'):
d={}
d['desc']=strip_tags(q.description.string).strip(' ')
if q.guid:
d['link']=q.guid.string
else:
d['link']=strip_tags(q.comments)
d['title']=q.title.string
for r in q.findAll('enclosure'):
d['image']=r['url']
arr.append(d)
誰でもそれを行うアイデアを教えてください..
これは、別のタグ内の画像を解析するために行ったことです...説明内にあるかどうかを取得しようとしましたが、できません。