title: BeautifulSoup - find class AND exclude another class
body: <p>I'm trying to get the time range from a source code of a page, using BeautifulSoup in python.</p>
  
  <p>The line I'm trying to parse look like this</p>
  
  <pre><code>&lt;span class="experience-date-locale"&gt;&lt;time&gt;June 2010&lt;/time&gt; – &lt;time&gt;August 2010&lt;/time&gt; (3 months)&lt;span class="locality"&gt;New York&lt;/span&gt;&lt;/span&gt;
  
  &lt;span class="experience-date-locale"&gt;&lt;time&gt;October 2015&lt;/time&gt; – Present (7 months)&lt;/span&gt;
  
  &lt;span class="experience-date-locale"&gt;&lt;time&gt;May 2010&lt;/time&gt; – &lt;time&gt;October 2011&lt;/time&gt; (6 months)&lt;/span&gt;
  </code></pre>
  
  <p>and I dont know how to get it right</p>
  
  <p>This line i tried didnt work becuase sometime I also have 'locality' class...</p>
  
  <pre><code>soup.find('span', {'class': 'experience-date-locale'}).text
  </code></pre>
  
  <p>this doesn't work too becuase I miss the 'present' part</p>
  
  <pre><code>soup.find('span', {'class': 'experience-date-locale'}).findAll('time').text
  </code></pre>
  
  <p>how can I exclude the part of the location and get only the time? </p>
  
  <p>The result should be :</p>
  
  <pre><code>June 2010 - August 2010 (3 months)
  
  October 2015 - present (7 months)
  
  May 2010 - October 2011 (6 month)
  </code></pre>