Merge branch 'master' into languages

This commit is contained in:
Adam Tauber 2016-12-28 20:00:53 +01:00 committed by GitHub
commit 8bff42f049
7 changed files with 104 additions and 15 deletions

View file

@ -72,9 +72,9 @@ def response(resp):
'content': ''.join(result.xpath('.//div[@class="st"]//text()')),
}
img = result.xpath('.//img/@src')[0]
if img and not img.startswith('data'):
r['img_src'] = img
imgs = result.xpath('.//img/@src')
if len(imgs) and not imgs[0].startswith('data'):
r['img_src'] = imgs[0]
results.append(r)