title: Python BS4 append extraSoup after a TEXT
body: <p>I have a file and I need to modify it with Python. there is a text inside of the file which is not included in any tag. it is like this:</p>
  <pre><code>===TEXT===
  </code></pre>
  <p>I need to append data after this text. I have a python script with BS4:</p>
  <pre><code>for index, row in df.iterrows():
          with open(&quot;template.html&quot;, 'r') as inf:
              html = inf.read()
              soup = bs4.BeautifulSoup(html, features=&quot;html.parser&quot;)
  
              extraSoup = bs4.BeautifulSoup(&quot;&quot;&quot;
              {{transclude name=&quot;link&quot; }}
              &quot;&quot;&quot;, &quot;html.parser&quot;)
  
              for container in soup.find(text=&quot;===TEXT===&quot;):
                  container.append(extraSoup)    
          prettyHTML = soup.prettify()  
          with open(&quot;template.html&quot;, 'w') as outf:
              outf.write(str(prettyHTML))
  </code></pre>
  <p>I am trying to find the text and append the extraSoup. But I get error</p>
  <pre><code>AttributeError: 'NoneType' object has no attribute
  </code></pre>
  <p>Is it even possible to do this with BS4? cause I think BS4 only work with tags? is there any way to achieve this?</p>