My First .py

Max M maxm at mxm.dk
Thu Apr 18 04:22:47 EDT 2002


Max M wrote:

whoops ... python or was offline when I wrote the code so I changed it 
to google, but naturally the code should then read ...

from urllib import urlopen

googleCom = urlopen('http://www.google.com')
content = googleCom.read()
googleCom.close()

print
content[content.find('<title>')+len('<title>'):content.find('</title>')]

>>> Google




More information about the Python-list mailing list