[fix] link attrib

This commit is contained in:
asciimoo 2013-10-20 20:53:12 +02:00
parent ec28b77a93
commit 15a2c27864

View File

@ -24,6 +24,6 @@ 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')
content = html.tostring(link)+'<br />'+link.attrib.get('title', '')
results.append({'url': url, 'title': title, 'content': content})
return results