[enh][mod] using image template rendering

This commit is contained in:
asciimoo
2013-10-22 23:34:45 +02:00
parent 31471ed936
commit 3a6d3e3377
3 changed files with 8 additions and 8 deletions

View File

@@ -24,6 +24,7 @@ def response(resp):
url = urljoin(base_url, link.attrib.get('href'))
title_links = result.xpath('.//span[@class="details"]//a[contains(@class, "t")]')
title = ''.join(title_links[0].xpath('.//text()'))
content = html.tostring(link)+'<br />'+link.attrib.get('title', '')
results.append({'url': url, 'title': title, 'content': content})
img_src = link.xpath('.//img')[0].attrib['src']
print img_src
results.append({'url': url, 'title': title, 'img_src': img_src, 'template': 'images.html'})
return results