Friday, 6 September 2013

Getting html tag value in python

Getting html tag value in python

I'm newbie to python. Here is my code working on python 2.7.5
import urllib2
import sys
url ="mydomain.com"
usock = urllib2.urlopen(url)
data = usock.read()
usock.close()
print data
Getting HTML markup like that and it works.
What I want to do is, to get value from inside <font class="big"></font>
tag. for ex. I need data value from this example:
<font class="big">Data</font>
How to do it?

No comments:

Post a Comment