You can use the dictionary interface to discover and delete the attributes:
for header in soup.findAll('h1'):
for attr, val in reversed(header.attrs):
del (header[attr])
--
Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6
Python Starship http://Starship.Python.net/crew/jwt/
Mailman IRC irc://irc.freenode.net/#mailman
--
You received this message because you are subscribed to the Google Groups "beautifulsoup" group.
To post to this group, send email to beauti...@googlegroups.com.
To unsubscribe from this group, send email to beautifulsou...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/beautifulsoup?hl=en.
I didn't test it, but I was leery of mutating the sequence as I
iterated over it.
> I'm finding that processing HTML seems to be a combination of doing simple
> replacements and regular expressions on the plain text, and other things
> using BeautifulSoup. Or I just haven't figured out enough yet about how
> BeautifulSoup works.
I rarely get out the regular expressions until I've isolated the text
nodes I'm interested in... unless I have to "fix" some broken HTML
before making soup.