🔵 🔵 🔵


Primary

၊၊||၊|။

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

Beautiful Soup Documentation — Beautiful Soup 4.4.0 documentation#extend

extend()

Starting in Beautiful Soup 4.7.0, Tag also supports a method called .extend(), which works just like calling .extend() on a Python list:

soup = BeautifulSoup("<a>Soup</a>")
soup.a.extend(["'s", " ", "on"])
 
soup
# <html><head></head><body><a>Soup's on</a></body></html>
soup.a.contents
# [u'Soup', u''s', u' ', u'on']

Printed 2026-06-28.

(echo:: @ )

Link to original

Secondary

• • •