title: Python - BeautifulSoup - Unable to extract Span Value
body: <p>I have an XML with mutiple Div Classes/Span Classes and I'm struggling to extract a text value. </p>
  
  <pre><code>   &lt;div class="line"&gt;
       &lt;span class="html-tag"&gt;
         "This is a Heading that I dont want"
       &lt;/span&gt;
       &lt;span&gt;This is the text I want&lt;/span&gt;
  </code></pre>
  
  <p>So far I have written this:</p>
  
  <pre><code>    html = driver.page_source
      soup = BeautifulSoup(html, "lxml")
      spans = soup.find_all('span', attrs={'class': 'html-tag'})[29]
      print(spans.text)
  </code></pre>
  
  <p>This unfortunately only prints out the "This is a Heading that I dont want" value e.g.</p>
  
  <pre><code>This is the heading I dont want
  </code></pre>
  
  <p>Number <code>[29]</code> in the code is the position where the text I need will always appear.</p>
  
  <p>I'm unsure how to retrieve the span value I need.</p>
  
  <p>Please can you assist. Thanks</p>