mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-05 18:49:23 +01:00
DDG: remove broken error catching (irc isn't in the _ddgurl namespace)
From: 52ec05a041
This commit is contained in:
parent
35677548df
commit
950aec696e
@ -62,10 +62,7 @@ class DDG(callbacks.Plugin):
|
||||
# DuckDuckGo has a 'lite' site free of unparseable JavaScript
|
||||
# elements, so we'll use that to our advantage!
|
||||
url = "https://duckduckgo.com/lite?" + urlencode({"q": text})
|
||||
try:
|
||||
data = utils.web.getUrl(url).decode("utf-8")
|
||||
except utils.web.Error as e:
|
||||
irc.error(str(e), Raise=True)
|
||||
data = utils.web.getUrl(url).decode("utf-8")
|
||||
soup = BeautifulSoup(data)
|
||||
# Remove "sponsored link" results
|
||||
return [td for td in soup.find_all('td') if 'result-sponsored' not in str(td.parent.get('class'))]
|
||||
|
Loading…
Reference in New Issue
Block a user