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