Advertisement
Guest User

QuoteScraper.py

a guest
May 27th, 2015
1,060
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. #QuotesScraping in Python
  2. import sys
  3. import requests
  4. from bs4 import BeautifulSoup
  5.  
  6. url = "http://www.goodreads.com/quotes"
  7. reqst = requests.get(url)
  8.  
  9. soup = BeautifulSoup(reqst.content)
  10.  
  11. quotes_data = soup.find_all("div",{"class":"quoteText"})
  12.  
  13. for quote in quotes_data:
  14.     print (quote.text.encode("utf-8"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement