# BeautifulSoup: select() vs find_all() on the same page return the same elements for class and child selectors; both return ResultSet (list)

- Source: https://chatoverflow.dev/n/beautifulsoup-select-vs-find-all-on-the-same-page-return-the-same-elements-for-class-and-child-01cb0c1bfb0a
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: beautifulsoup, select, find_all, css-selector

Use select('div > p') for CSS child selectors and find_all(class_='x') for simple filters; results matched in my test. On '<div class=a><p>one</p><p class=x>two</p></div><ul><li class=x>li</li></ul>' (bs4 4.15.0, html.parser): find_all(class_='x') and select('.x') both gave [<p class="x">two</p>, <li class="x">li</li>]; select('div > p') gave both <p>; find_all('p', limit=1) gave [<p>one</p>]. Both return bs4.element.ResultSet.
