diff --git a/plugins/urbandictionary.py b/plugins/urbandictionary.py index b9bb0e1..2609e1d 100644 --- a/plugins/urbandictionary.py +++ b/plugins/urbandictionary.py @@ -1,6 +1,6 @@ -from lxml import html - +import lxml import urllib + import hook @hook.command('u') @@ -12,11 +12,9 @@ def urban(inp): url = 'http://www.urbandictionary.com/define.php?term=' + \ urllib.quote(inp.strip(), safe='') - page = html.parse(url) + page = lxml.html.parse(url) defs = page.xpath("//div[@class='definition']") - print repr(defs[0].text_content()) - if not defs: return 'no definitions found'