import urllib.request, urllib.error, urllib.parse
from BeautifulSoup import BeautifulSoup
soup = BeautifulSoup(urllib.request.urlopen('https://www.google.com'))
print(soup.title.string)
How can I retrieve the page title of a webpage using Python?