need help with python syntax

Cyril Bazin cyril.bazin at gmail.com
Thu Aug 11 17:47:28 EDT 2005


I think bs = BeautifulSoup.BeautifulSoup( oFile) but I don't understand what 
you are doing...
(I never used BeautifulSoup...)

Maybe It is somthing like:

import itertools
for incident in itertools.chain(bs('tr', {'bgcolor' : '#eeeeee'}), bs('tr', 
{'bgcolor' : 'white'})):
do_something()

Look at some examples on the web or ask a precise question (what is your 
problem exactly?):
http://www.petersblog.org/taxonomy/term/2
http://crummy.com/software/BeautifulSoup/documentation.html
... 

Cyril

On 11 Aug 2005 11:56:49 -0700, yaffa <yxxxxlxxxxx at gmail.com> wrote:
> 
> dear python gurus,
> 
> quick question on syntax.
> 
> i have a line of code like this
> 
> for incident in bs('tr', {'bgcolor' : '#eeeeee'}):
> 
> 
> what i want it to do is look for 'bgcolor' : '#eeeeee' or 'bgcolor' :
> 'white' and then do a whole bunch of stuff.
> 
> i've tried this:
> 
> for incident in bs('tr', {'bgcolor' : '#eeeeee'} or {'bgcolor' :
> 'white'} ): but it only seems to pick up the stuff from the
> {'bgcolor' : '#eeeeee'}
> 
> 
> any ideas folks?
> 
> thanks
> 
> yaffa
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050811/c634ad25/attachment.html>


More information about the Python-list mailing list