[Tutor] Beautifulsoup4 question

Danny Yoo dyoo at hashcollision.org
Thu Oct 2 01:02:51 CEST 2014


Hi Juan,

What you should be getting back from the call to find_all() should
already be dictionary-like.  Although they *print* like HTML, they're
really soups.

So you should already be able to do:

#############################################
full_item_list = self._soup.find_all('li', {'data-app': '440'})

for item in full_item_list:
    print item['data-name']
#############################################

That is to say that what you're getting back from
self._soup.find_all() is definitely not raw: it's parsed, it's soupy,
and you can continue to deal with it structurally.


More information about the Tutor mailing list