regarding html source code

subeen tamim.shahriar at gmail.com
Mon Feb 11 13:19:27 EST 2008


Another way:

import urllib2

usock = urllib2.urlopen('http://abc.com')
data = usock.read()
usock.close()

print data




On Feb 12, 12:05 am, Stefan Behnel <stefan... at behnel.de> wrote:
> Hi,
>
> shashank jain top-posted:
>
>
>
> > On Feb 11, 2008 11:15 PM, Stefan Behnel <stefan... at behnel.de> wrote:
>
> >> jainshasha wrote:
> >>> well i have create a program which can read out the html source code
> >>> files or any other web page source code files through my program so
> >> Like this?
>
> >>  >>> from lxml import html
> >>  >>> page = html.parse("http://www.google.com")
> >>  >>> print page.find("//title").text
> >>  Google
>
> >>http://codespeak.net/lxml
>
> > well i would like to know how python can help me in doing this or if u think
> > any other language please help me out
>
> What I showed you was Python code that reads an HTML file. What else do you need?
>
> Stefan




More information about the Python-list mailing list