'''from urllib.request import urlopen
from bs4 import BeautifulSoup

html = urlopen("http://www.facebook.com")
bsobject = BeautifulSoup(html.read(),"html.parser")
print(bsobject.herf)

#print(html.read())
'''
from bs4 import BeautifulSoup
import requests
 
url = "http://www.google.com"
 
# Getting the webpage, creating a Response object.
response = requests.get(url)
 
# Extracting the source code of the page.
data = response.text
 
# Passing the source code to BeautifulSoup to create a BeautifulSoup object for it.
soup = BeautifulSoup(data, 'lxml')
 
# Extracting all the <a> tags into a list.
tags = soup.find_all('a')
 
# Extracting URLs from the attribute href in the <a> tags.
for tag in tags:
    print(tag.get('href'))