Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import urllib
  2. import urllib.request
  3. from bs4 import BeautifulSoup
  4.  
  5. #theurl = "https://twitter.com/sachin_rt"
  6. #thepage = urllib.request.urlopen(theurl)
  7. #Soup = BeautifulSoup(thepage,"html.parser")
  8. #print(Soup.findAll('a')[0])
  9. #print(Soup.find('div',{"class":"ProfileHeaderCard"}).find('p').text)
  10. try:
  11. r = requests.get("http://www.yellowpages.com/search?search_terms=coffee&geo_location_terms=Bangalore%2C+19")
  12. thepage=r.content
  13. Soup = BeautifulSoup(thepage,"html.parser")
  14. print(Soup.find_all("a"))
  15.  
  16. except Exception:
  17. print(traceback.format_exc())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement