Here's my code :
v_card = soup.find('div', {'class':'col subgroup vcard'})
if v_card is not None :
print v_card.prettify()
infos = v_card.findAll('li')
print infos[0].text()
Here's the output :
<div class="col subgroup vcard">
<ul>
<li>
infos I need to get
</li>
<li>
infos I need to get
</li>
<li>
</li>
</ul>
</div>
Traceback (most recent call last):
File "./xxxx.py", line 43, in <module>
print infos[0].text()
TypeError: 'unicode' object is not callable
Note that if I remove the .text()
method, then it prints successfully the <li>
tag and its content.
This is weird because with other elements I have no problem using .text()
, I don't get it, any explanations ?