瀏覽代碼

[fix] handle missing url scheme - fixes #428

Adam Tauber 9 年之前
父節點
當前提交
e3df22b140
共有 1 個檔案被更改,包括 2 行新增0 行删除
  1. 2
    0
      searx/engines/gigablast.py

+ 2
- 0
searx/engines/gigablast.py 查看文件

53
     # parse results
53
     # parse results
54
     for result in dom.xpath(results_xpath):
54
     for result in dom.xpath(results_xpath):
55
         url = result.xpath(url_xpath)[0].text
55
         url = result.xpath(url_xpath)[0].text
56
+        if not url.startswith('http://') and not url.startswith('https://'):
57
+            url = 'http://' + url
56
         title = result.xpath(title_xpath)[0].text
58
         title = result.xpath(title_xpath)[0].text
57
         content = escape(result.xpath(content_xpath)[0].text)
59
         content = escape(result.xpath(content_xpath)[0].text)
58
 
60