summaryrefslogtreecommitdiff
path: root/searx/engines/yahoo.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2014-02-27 10:59:39 +0100
committerAdam Tauber <asciimoo@gmail.com>2014-02-27 10:59:39 +0100
commit46277888340ceaa76233c57be23fb21591188e26 (patch)
treeab5485d258ebea7cf56d483330915923c42d5728 /searx/engines/yahoo.py
parent8c8d9d10cb69234f295fc9d0f1ba6c739c3e7147 (diff)
downloadsearxng-46277888340ceaa76233c57be23fb21591188e26.tar.gz
searxng-46277888340ceaa76233c57be23fb21591188e26.zip
[fix] yahoo url mods
Diffstat (limited to 'searx/engines/yahoo.py')
-rw-r--r--searx/engines/yahoo.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/searx/engines/yahoo.py b/searx/engines/yahoo.py
index 3dba4c432..f83b4b967 100644
--- a/searx/engines/yahoo.py
+++ b/searx/engines/yahoo.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
from urllib import urlencode
+from urlparse import unquote
from lxml import html
from searx.engines.xpath import extract_text, extract_url
@@ -33,7 +34,10 @@ def response(resp):
dom = html.fromstring(resp.text)
for result in dom.xpath(results_xpath):
- url = extract_url(result.xpath(url_xpath), search_url)
+ url_string = extract_url(result.xpath(url_xpath), search_url)
+ start = url_string.find('/RU=')+4
+ end = url_string.rfind('/RS')
+ url = unquote(url_string[start:end])
title = extract_text(result.xpath(title_xpath)[0])
content = extract_text(result.xpath(content_xpath)[0])
results.append({'url': url, 'title': title, 'content': content})