Beautiful Soups Choosing the Vs Find_all Type

I'm new to webscraping, and there seem to be two ways to collect ALL the html data I'm looking for.

option_1 = soup.find_all('div', class_='p')

option_2 = soup.select('div.p')

I see that option_1 returns the class 'bs4.element.ResultSet' and option_2 returns the class 'list'

I can still iterate over option_1 with a for loop, so what is the difference between:

  • select and find_all
  • 'list' and bs4.element.ResultSet
+4
source share

Source: https://habr.com/ru/post/1687833/


All Articles