# To get the title from BeautifulSoup
def getTitle(url):
try:
html=urlopen(url)
except HTTPError as e:
return None
try:
bs=BeautifulSoup(html.read(), 'html.parser')
title=bs.body.h1
except AttributeError as e:
return None
return title