[fix] link attrib

This commit is contained in:
asciimoo 2013-10-20 20:53:12 +02:00
parent ec28b77a93
commit 15a2c27864
1 changed files with 1 additions and 1 deletions

View File

@ -24,6 +24,6 @@ def response(resp):
url = urljoin(base_url, link.attrib.get('href')) url = urljoin(base_url, link.attrib.get('href'))
title_links = result.xpath('.//span[@class="details"]//a[contains(@class, "t")]') title_links = result.xpath('.//span[@class="details"]//a[contains(@class, "t")]')
title = ''.join(title_links[0].xpath('.//text()')) 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}) results.append({'url': url, 'title': title, 'content': content})
return results return results