I have problem similar to describe here, but a bit more complicated. There are BeautifulSoup objects (store in list) and I want to find some other tags. The information which tags I want to find are store in strings.
I.e.:
a= [...] #(list of BeautifulSoup objects)
next="findNext('span')"
b=[ getattr(c,next).string for c in a]
doesn’t work. What I do wrong.
Looks to me like what you want is:
This will call
findNext('span')for each elementcof the listaand form a list of the results of eachfindNextcall in the listb.