<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title For Title 哦</title>
</head>
<body>
</body>
</html>
import re
fd = open('titlecode.html', 'r')
codedata = fd.read()
fd.close()
regex = re.compile('<title>(.*)</title>')
data = re.findall(regex, codedata)
print data[0]
title