🔵 🔵 🔵


Primary

၊၊||၊|။

Tag.find_all() ⚬|Documentation|1st|20260122170548-00-⌔

Beautiful Soup Documentation — Beautiful Soup 4.4.0 documentation#find-all

find_all()

Signature: find_all(name, attrs, recursive, string, limit, ﹡﹡kwargs)

The find_all() method looks through a tag’s descendants and retrieves all descendants that match your filters. I gave several examples in Kinds of filters, but here are a few more:

soup.find_all("title")
# [<title>The Dormouse's story</title>]
 
soup.find_all("p", "title")
# [<p class="title"><b>The Dormouse's story</b></p>]
 
soup.find_all("a")
# [<a class="sister" href="http://example.com/elsie" id="link1">Elsie</a>,
#  <a class="sister" href="http://example.com/lacie" id="link2">Lacie</a>,
#  <a class="sister" href="http://example.com/tillie" id="link3">Tillie</a>]
 
soup.find_all(id="link2")
# [<a class="sister" href="http://example.com/lacie" id="link2">Lacie</a>]
 
import re
soup.find(string=re.compile("sisters"))
# u'Once upon a time there were three little sisters; and their names were\n'

Some of these should look familiar, but others are new. What does it mean to pass in a value for string, or id? Why does find_all("p", "title") find a

tag with the CSS class “title”? Let’s look at the arguments to find_all().

Printed 2026-06-28.

(echo:: @ )

Link to original

Secondary

• • •