diff options
| author | Alexandre Flament <alex@al-f.net> | 2021-11-21 21:26:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-21 21:26:20 +0100 |
| commit | 02cccdf876f2e0b07ef488e6033a858113dc3f1c (patch) | |
| tree | 393d06394affc23298abce3ac1e783c93527ac96 /searx | |
| parent | d51298177aa9917fc862d44f56dc0249752dc8d9 (diff) | |
| parent | 5b28c9109f58685e14da17a83e4ee0f28c9d53c4 (diff) | |
Merge pull request #533 from return42/fix-532
[fix] google images: @href index 0 not found
Diffstat (limited to 'searx')
| -rw-r--r-- | searx/engines/google_images.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py index ffdd6675e..61d291e3f 100644 --- a/searx/engines/google_images.py +++ b/searx/engines/google_images.py @@ -172,7 +172,10 @@ def response(resp): thumbnail_src = '' link_node = eval_xpath_getindex(img_node, '../../../a[2]', 0) - url = eval_xpath_getindex(link_node, '@href', 0) + url = eval_xpath_getindex(link_node, '@href', 0, None) + if url is None: + logger.error("missing @href in node: %s", html.tostring(link_node)) + continue pub_nodes = eval_xpath(link_node, './div/div') pub_descr = img_alt |