[Tutor] Beautifulsoup4 question
Juan Christian
juan0christian at gmail.com
Thu Oct 2 02:37:58 CEST 2014
On Wed, Oct 1, 2014 at 8:02 PM, Danny Yoo <dyoo at hashcollision.org> wrote:
> 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.
>
OH MY GOD! Super fail, hahaha.
Thanks, bs4 is incredible. I thought they were RAW html data. Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20141001/beacd200/attachment.html>
More information about the Tutor
mailing list