HTML Parser - beginner needs help
Opinderjit
bhellao at my-deja.com
Thu Sep 14 15:11:29 EDT 2000
I am not sure what you actually want however, is this it....
Get the HTMLGen module from
http://starship.python.net/crew/friedrich/HTMLgen/html/main.html
and do the following:
from HTMLgen.HTMLgen import Image
i = Image(".\path\to\a\valid\image")
print i
Output:
<IMG src=".\path\to\a\valid\image" alt="image">
Or are you trying to parse an existing HTML file for image tags?
In article <968956212.35650 at ipt2.iptelecom.net.ua>,
"zet" <zet at i.com.ua> wrote:
> Can somebody provide small piece of code, which returns list of img
tags?
> I've trying this lines:
>
> class IMGParser(HTMLParser):
> def end_img(arg):
> return
>
> but it return only an anchors, how to get IMG's?
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
More information about the Python-list
mailing list