Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import sys
- import urllib
- from bs4 import BeautifulSoup
- if len(sys.argv) == 1:
- print "Usage: ./bash-cli.py <bash paste id>"
- exit();
- url = "http://bash.org.pl/" + sys.argv[1]
- f = urllib.urlopen(url)
- html = f.read()
- soup = BeautifulSoup(html, "lxml")
- quote = soup.find("div", class_="quote post-content post-body")
- print quote.contents[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement