def is_hatenatop(url):
try:
html = request.urlopen("http://hatenablog.com/")
except urllib.HTTPError as e:
print(e.reason)
except urllib.URLError as e:
print(e.reason)
soup = BeautifulSoup(html,"lxml")
a = soup.find("a",href=url)
if a is None:
return False
return url == a.get("href")
评论列表
文章目录