summaryrefslogtreecommitdiff
path: root/searx/engines/startpage.py
diff options
context:
space:
mode:
authorNoémi Ványi <kvch@users.noreply.github.com>2019-01-04 22:27:05 +0100
committerGitHub <noreply@github.com>2019-01-04 22:27:05 +0100
commit1ea56576dc4f2fb65b9028c900c2e4fb063a8b9a (patch)
treee4d0e50c0494ca49a41351edea532c00289386a3 /searx/engines/startpage.py
parent0e493db2fb06fd78ac05f82abd8b1cc86089684f (diff)
parent899ba5d6dee82faacb572b4d9bc4c58570628531 (diff)
Merge branch 'master' into devel_google_videos
Diffstat (limited to 'searx/engines/startpage.py')
-rw-r--r--searx/engines/startpage.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py
index 3e067597e..55efdc884 100644
--- a/searx/engines/startpage.py
+++ b/searx/engines/startpage.py
@@ -32,8 +32,9 @@ search_url = base_url + 'do/search'
# specific xpath variables
# ads xpath //div[@id="results"]/div[@id="sponsored"]//div[@class="result"]
# not ads: div[@class="result"] are the direct childs of div[@id="results"]
-results_xpath = '//div[@class="result"]'
+results_xpath = '//li[contains(@class, "search-result") and contains(@class, "search-item")]'
link_xpath = './/h3/a'
+content_xpath = './p[@class="search-item__body"]'
# do search-request
@@ -73,14 +74,10 @@ def response(resp):
if re.match(r"^http(s|)://(www\.)?startpage\.com/do/search\?.*$", url):
continue
- # block ixquick search url's
- if re.match(r"^http(s|)://(www\.)?ixquick\.com/do/search\?.*$", url):
- continue
-
title = extract_text(link)
- if result.xpath('./p[@class="desc clk"]'):
- content = extract_text(result.xpath('./p[@class="desc clk"]'))
+ if result.xpath(content_xpath):
+ content = extract_text(result.xpath(content_xpath))
else:
content = ''