mirror of
https://github.com/searxng/searxng.git
synced 2025-08-17 01:06:44 +02:00
Yahoo's unit test
This commit is contained in:
parent
ff2ad57a87
commit
9f13af8d3c
3 changed files with 157 additions and 2 deletions
|
@ -35,7 +35,7 @@ suggestion_xpath = '//div[@id="satat"]//a'
|
|||
def parse_url(url_string):
|
||||
endings = ['/RS', '/RK']
|
||||
endpositions = []
|
||||
start = url_string.find('http', url_string.find('/RU=')+1)
|
||||
start = url_string.find('http', url_string.find('/RU=') + 1)
|
||||
|
||||
for ending in endings:
|
||||
endpos = url_string.rfind(ending)
|
||||
|
@ -91,7 +91,7 @@ def response(resp):
|
|||
'content': content})
|
||||
|
||||
# if no suggestion found, return results
|
||||
if not suggestion_xpath:
|
||||
if not dom.xpath(suggestion_xpath):
|
||||
return results
|
||||
|
||||
# parse suggestion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue