mirror of
https://github.com/searxng/searxng.git
synced 2024-12-23 09:46:31 +00:00
[fix] handle missing images in google news
This commit is contained in:
parent
4b225eb7ef
commit
0171db5c3f
1 changed files with 3 additions and 3 deletions
|
@ -70,9 +70,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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue