Created
July 30, 2014 20:33
-
-
Save majorpakhom/2d04088be1e1786c002f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def get_tag(body,tag): | |
T = re.findall('<%s.*?>(.*?)</%s>' % (tag,tag),body,re.S) | |
if T: return T[0] | |
else: return '' | |
def main(): | |
page = open("check.html", "rb").read().decode('utf-8') | |
print(get_tag(page,"title")) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment