title: Using aria-label to locate and click an element with Python3 and Selenium
body: <p>I want to click or more respectively, expand the "Any time" button. I've tried to locate the element by class_name and xpath. The problem is that the class and xpath are the same for all three 'options'. So, I would like to select and click or expand on that element by using the aria-label. I found a couple of suggestions, but it didn't work for me. Most importantly, I try to do that in python 3. I also tried:</p>
  
  <pre><code>driver.find_element_by_xpath(""" //div*[@aria-label='Any Time'] """).click()
  </code></pre>
  
  <p>but it doesn't work. </p>
  
  <p>Could anyone please help me? Many thanks in advance!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="hdtb-mn-hd" aria-haspopup="true" role="button" tabindex="0" aria-label="Any country"&gt;&lt;div class="mn-hd-txt"&gt;Any country&lt;/div&gt;&lt;span class="mn-dwn-arw"&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div class="hdtb-mn-hd" aria-haspopup="true" role="button" tabindex="0" aria-label="Any time"&gt;&lt;div class="mn-hd-txt"&gt;Any time&lt;/div&gt;&lt;span class="mn-dwn-arw"&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div class="hdtb-mn-hd" aria-haspopup="true" role="button" tabindex="0" aria-label="All results"&gt;&lt;div class="mn-hd-txt"&gt;All results&lt;/div&gt;&lt;span class="mn-dwn-arw"&gt;&lt;/span&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>