How to extract data from an html file using python?

ipython

#1

Hello,
I have been trying to do google basic exercises on python.I tried to read a html file using pd.read_html().
But since the data is not in the table format only ranks are in order and the string content like names come in the form of NAN ,NAT


Data can be accessed from the following link:
https://developers.google.com/edu/python/exercises/baby-names
Thanks


#2

@mukesh,

you can extract information from Html file using library urllib. It helps you to read the html source code and after that you can apply regular expression to extract required information.

You can read more detail about urllib here:
https://docs.python.org/2/library/urllib.html

Regards,
Satish