python beautifulsoup get all children code example Example: get only parent child elements beautiful soup >>> soup.select('li.test > a') [<a>link1</a>, <a>link3</a>]