title: How to extract the content of this element?
body: <p>I'm trying to extract <code>&lt;div class=&quot;ex_example&quot;&gt; aa &lt;/div&gt; &lt;div class=&quot;ex_example&quot;&gt; aa &lt;/div&gt;</code></p>
  <p>from :</p>
  <pre><code>    &lt;div class=&quot;c-w&quot;&gt;
        &lt;div class=&quot;c-s&quot;&gt;
          &lt;div class=&quot;ex_example&quot;&gt; aa &lt;/div&gt;
          &lt;div class=&quot;ex_example&quot;&gt; aa &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  <p>with below code :</p>
  <pre><code>from bs4 import BeautifulSoup
  
  txt = '''
  &lt;div class=&quot;c-w&quot;&gt;
    &lt;div class=&quot;c-s&quot;&gt;
      &lt;div class=&quot;ex_example&quot;&gt; aa &lt;/div&gt;
      &lt;div class=&quot;ex_example&quot;&gt; aa &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  '''
  
  soup = BeautifulSoup(txt, 'html.parser')
  soup.select('.c-w .c-s')[0].contents
  </code></pre>
  <p>Unfortunately, the output is not as expected,</p>
  <pre><code>['\n',
   &lt;div class=&quot;ex_example&quot;&gt; aa &lt;/div&gt;,
   '\n',
   &lt;div class=&quot;ex_example&quot;&gt; aa &lt;/div&gt;,
   '\n']
  </code></pre>
  <p>Could you please modify my code to achieve my goal? Thank you so much!</p>