Python
# -*- coding: utf-8 -*- from BeautifulSoup import BeautifulSoup soup = BeautifulSoup("<b>git</b>") print soup # => <b>git</b> print soup.b # => <b>git</b> print soup.b.string # => git soup.find(text='git').replaceWith('Git') print soup # => <b>Git</b> print soup.b # …