Skip to content

Commit

Permalink
DDG: bugfix for older versions of beautifulsoup4
Browse files Browse the repository at this point in the history
  • Loading branch information
James Lu committed Dec 19, 2014
1 parent 826bcf9 commit ad0a5dd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions DDG/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,12 @@ def search(self, irc, msg, args, text):
res = ''
for t in soup.find_all('td'):
if "1." in t.text:
res = t.next_sibling.next_sibling
res = t.next_sibling.next_sibling
if not res:
continue
try:
# 1) Get a result snippet.
snippet = res.parent.next_sibling.next_sibling.find("td",
class_="result-snippet")
snippet = res.parent.next_sibling.next_sibling.find_all("td")[-1]
# 2) Fetch the result link.
link = res.a.get('href')
snippet = snippet.text.strip()
Expand Down

0 comments on commit ad0a5dd

Please sign in to comment.