嗨我想從多個網站rss提取圖像。解析rss不同標籤提取圖像
首先RSS
<enclosure type="image/jpeg" length="321742" url="http://www.sitio.com.uy//uploads/2014/10/19/54441d68e01af.jpg"/>
二RSS
<g:image_link>http://img.sitio2.com/imagenes/314165_20150422201743_635653477836873822w.jpg</g:image_link>
需要提取圖像的URL。
我的代碼是Beatifulsoup在python
response = requests.get(url)
soup = bs4.BeautifulSoup(response.text)
items = soup.find_all('item')
for item in items:
title = item.find('title').get_text().encode('utf-8')
description = item.find('description').get_text().encode('utf-8')
category = item.find('category').get_text().encode('utf-8')
image = item.find('enclosure')
print(image)
而且,怎麼了? –
非功能g:image_link – user3058963