[fix] yahoo engine url extraction

This commit is contained in:
Adam Tauber 2014-03-04 14:19:59 +01:00
parent 2d42208e83
commit ee1ffbc87f
2 changed files with 2 additions and 2 deletions

View file

@ -35,7 +35,7 @@ def response(resp):
for result in dom.xpath(results_xpath): for result in dom.xpath(results_xpath):
url_string = extract_url(result.xpath(url_xpath), search_url) url_string = extract_url(result.xpath(url_xpath), search_url)
start = url_string.find('/RU=')+4 start = url_string.find('http', url_string.find('/RU=')+1)
end = url_string.rfind('/RS') end = url_string.rfind('/RS')
url = unquote(url_string[start:end]) url = unquote(url_string[start:end])
title = extract_text(result.xpath(title_xpath)[0]) title = extract_text(result.xpath(title_xpath)[0])

View file

@ -35,7 +35,7 @@ def response(resp):
for result in dom.xpath(results_xpath): for result in dom.xpath(results_xpath):
url_string = extract_url(result.xpath(url_xpath), search_url) url_string = extract_url(result.xpath(url_xpath), search_url)
start = url_string.find('/RU=')+4 start = url_string.find('http', url_string.find('/RU=')+1)
end = url_string.rfind('/RS') end = url_string.rfind('/RS')
url = unquote(url_string[start:end]) url = unquote(url_string[start:end])
title = extract_text(result.xpath(title_xpath)[0]) title = extract_text(result.xpath(title_xpath)[0])