[Tutor] htmllib

Ed Singleton singletoned at gmail.com
Wed Oct 5 14:02:40 CEST 2005


You're like some kind of god!

That's exactly what I need.

Thanks

Ed

On 05/10/05, Kent Johnson <kent37 at tds.net> wrote:
> Ed Singleton wrote:
> > I want to dump a html file into a python object.  Each nested tag
> > would be a sub-object, attributes would be properties.  So that I can
> > use Python in a similar way to the way I use JavaScript within a web
> > page.
>
> I don't know of a way to run Python from within a web page. But if you want to fetch an HTML page from a server and work with it (for example a web-scraping app), many people use BeautifulSoup for this. If you have well-formed HTML or XHTML you can use an XML parser as well but BS has the advantage of coping with badly-formed HTML.
> http://www.crummy.com/software/BeautifulSoup/
>
> Kent
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>


More information about the Tutor mailing list