i am trying to use beautifulsoup to get birthdays for persons from wikipedia. for example the birthday for http://en.wikipedia.org/wiki/Ezra_Taft_Benson is August 4, 1899. to get to the bday, i am using the following code:
bday = url.find("span", class_="bday")
However it is picking up the instance where bday
appears in the html code as part of another tag. i.e <span class="bday dtstart published updated">1985-11-10 </span>
.
is there a way to match the exact class tag with bday
only?
I hope the question is clear as currently I am getting the bday
to be 1985-11-10 which is not the correct date.