Please consider the following python session:
>>> from BeautifulSoup import BeautifulSoup >>> s = BeautifulSoup(\"This is
This is
Simpler answer : after your call to replaceWith, regenerate and clean s by calling s = BeautifulSoup(s.renderContents()). Then you can find again.
replaceWith
s
s = BeautifulSoup(s.renderContents())
find