how to find not the next sibling but the 2nd sibling or findsibling "a" OR sinbling "b"

localpricemaps at localpricemaps at
Mon Jan 23 13:32:56 EST 2006

well actually all i want it to do is find the first thing that shows up
whether its class:food or class: drink so that works for me.  only
thing is that after it finds class:food i think it runs through the
html again and finds the following class:drink and being that there is
not class tag after that class: drink tag it fails.

Fredrik Lundh wrote:
> homepricemaps at wrote:
> > ok i found something that works.  instead of using the def i did this:
> >
> > for incident in row('div', {'class': 'food' or 'drink' }):
> >
> > and it worked!
> 'food' or 'drink' doesn't do what you think it does:
>     >>> 'food' or 'drink'
>     'food'
>     >>> {'class': 'food' or 'drink'}
>     {'class': 'food'}
> </F>

More information about the Python-list mailing list