Advertisement
dancewtd

Python UD

Mar 26th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. from bs4 import BeautifulSoup
  2. import urllib2
  3. x = raw_input("> ")
  4. openurl = urllib2.urlopen("http://www.urbandictionary.com/define.php?term="+x)
  5. soup = BeautifulSoup(openurl)
  6. for i in soup.find_all("div", {"class":"meaning"}):
  7.     print i.get_text()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement