fix ddg
This commit is contained in:
parent
96f7975747
commit
7d7c7c9407
1 changed files with 1 additions and 1 deletions
|
@ -15,7 +15,7 @@ def find(query, timeout=ox.cache.cache_timeout):
|
||||||
url = 'http://duckduckgo.com/html/?' + params
|
url = 'http://duckduckgo.com/html/?' + params
|
||||||
data = read_url(url, timeout=timeout, unicode=True)
|
data = read_url(url, timeout=timeout, unicode=True)
|
||||||
results = []
|
results = []
|
||||||
regex = '<a .*?class="l le" href="(.+?)">(.*?)</a>.*?<div class="cra">(.*?)</div>'
|
regex = '<a .*?class="large" href="(.+?)">(.*?)</a>.*?<div class="snippet">(.*?)</div>'
|
||||||
for r in re.compile(regex, re.DOTALL).findall(data):
|
for r in re.compile(regex, re.DOTALL).findall(data):
|
||||||
results.append((strip_tags(decode_html(r[1])), r[0], strip_tags(decode_html(r[2]))))
|
results.append((strip_tags(decode_html(r[1])), r[0], strip_tags(decode_html(r[2]))))
|
||||||
return results
|
return results
|
||||||
|
|
Loading…
Reference in a new issue