On Fri, Sep 28, 2012 at 1:10 PM, <tutor-requ...@python.org> wrote: > Date: Sun, 16 Sep 2012 12:50:09 +0530 > From: Santosh Kumar <sntshkm...@gmail.com> > To: tutor@python.org > Subject: [Tutor] list all links with certain extension in an html file > python > Message-ID: > < > cae7maqa53x8pav96q2ka0vajhnjtrz_rgzcmh_cbsaqdiz5...@mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > I want to extract (no I don't want to download) all links that end in > a certain extension. > > <link rel="stylesheet" type="text/css" href="http://foo.bar/part1.css > "> > > Please note that I don't want to download those CSS, instead I want > something like this (to stdout): > > http://foo.bar/part1.css > > Also I don't want to use external libraries. I am asking for: which > libraries and functions should I use? > > > do you mean, you want to parse the file and the URL of those css files, then parse the file, there are many parsing options http://lxml.de/parsing.html
you don't have to use external libraries either, you may use http://docs.python.org/library/htmlparser.html or regular expressions or may be I did't understood what you really want to do. Br - Hussain
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor