I have a html snippet as below:
<div class="single_baby_name_description">
<label>Meaning :</label> <span class="28816-meaning">the meaning of this name is universal whole.</span> </br>
<label>Gender :</label> <span class="28816-gender">Girl</span> </br>
<label>Religion :</label> <span class="28816-religion">Christianity</span> </br>
<label>Origin :</label> <span class="28816-origin">German,French,Swedish</span> </br>
</div>
I attempt to extract text from all span inside div using
soup = BeautifulSoup(html,'html.parser')
spans=soup.select('div.single_baby_name_description>span')
But spans[0].text gets only the text from the first tag . And spans[1].text occurs IndexError: list index out of range.
Any help would be greatly appreciated.