Reputation: 3223
i have a xml like this:
<dd class='date'>
0705
</dd>
<dd class='date'>
0707
</dd>
<dd class='date'>
0710
</dd>
<dd class='date'>
0714
</dd>
the output i want is(i'm finding # of ):
4
is there a neat way to do this job? any help would be great. thanks in advance
Upvotes: 0
Views: 57
Reputation: 18477
soup = BeautifulSoup("xml/html content")
tags = soup.find("some_tag")
print len(tags)
len(tags)
will give you total number of tags.
Upvotes: 1