beautiful soup to get next child element code example
Example 1: children beautiful soup
li = soup.find('li', {'class': 'text'})
children = li.findChildren("a" , recursive=False)
for child in children:
print child
Example 2: how to get child element li beautifulsoup
>>> soup.select('li.test > a')
[<a>link1</a>, <a>link3</a>]