Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib
- import urllib.request
- from bs4 import BeautifulSoup
- #theurl = "https://twitter.com/sachin_rt"
- #thepage = urllib.request.urlopen(theurl)
- #Soup = BeautifulSoup(thepage,"html.parser")
- #print(Soup.findAll('a')[0])
- #print(Soup.find('div',{"class":"ProfileHeaderCard"}).find('p').text)
- try:
- r = requests.get("http://www.yellowpages.com/search?search_terms=coffee&geo_location_terms=Bangalore%2C+19")
- thepage=r.content
- Soup = BeautifulSoup(thepage,"html.parser")
- print(Soup.find_all("a"))
- except Exception:
- print(traceback.format_exc())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement