title: Find Element Using Two Criteria in Python Selenium
body: <p>I am trying to find an element in a table to firstly scrape the text/number and then, if it meets criteria, click on it.</p>
  <p>Here's an example page: <a href="https://www.oddschecker.com/horse-racing/wolverhampton/20:30/winner" rel="nofollow noreferrer">https://www.oddschecker.com/horse-racing/wolverhampton/20:30/winner</a>.</p>
  <p>To do this I need to locate the selection name in the table row (<code>class=&quot;diff-row evTabRow bc&quot;</code>) and the book in the data cell (<code>data-bk=&quot;PP&quot;</code>).</p>
  <pre><code>selection = 'Aramis Grey'
  book = 'PP'
  </code></pre>
  <p>I'm new to selenium and can find the individual elements but don't know how to combine the criteria for different elements.</p>
  <p>Edit:</p>
  <p>The original link is no longer available but trying the suggestions using this link <a href="https://www.oddschecker.com/horse-racing/kempton/20:30/winner" rel="nofollow noreferrer">https://www.oddschecker.com/horse-racing/kempton/20:30/winner</a> gives me the following error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:/Users/Oddschecker v5.py&quot;, line 42, in &lt;module&gt;
      wait.until(EC.visibility_of_element_located((By.CSS_SELECTOR, '[class=&quot;diff-row evTabRow bc&quot;][data-bname=&quot;Blue Beret&quot;] [data-bk=&quot;WH&quot;]'))).click()
    File &quot;C:\Users\Python37\lib\site-packages\selenium\webdriver\remote\webelement.py&quot;, line 80, in click
      self._execute(Command.CLICK_ELEMENT)
    File &quot;C:\Users\Python37\lib\site-packages\selenium\webdriver\remote\webelement.py&quot;, line 693, in _execute
      return self._parent.execute(command, params)
    File &quot;C:\Users\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py&quot;, line 400, in execute
      self.error_handler.check_response(response)
    File &quot;C:\Users\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py&quot;, line 236, in check_response
      raise exception_class(message, screen, stacktrace)
  selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element &lt;td class=&quot;bc bs oi&quot; data-bk=&quot;WH&quot; data-odig=&quot;4.33&quot; data-o=&quot;10/3&quot; data-hcap=&quot;&quot; data-fodds=&quot;12.0&quot; data-best-ew=&quot;false&quot; data-best-wo=&quot;false&quot; data-ew-denom=&quot;5&quot; data-ew-places=&quot;4&quot;&gt;...&lt;/td&gt; is not clickable at point (762, 864). Other element would receive the click: &lt;div class=&quot;_3g1ozk&quot;&gt;...&lt;/div&gt;
    (Session info: chrome=94.0.4606.61)
  Stacktrace:
  Backtrace:
      Ordinal0 [0x015CD403+2479107]
      Ordinal0 [0x01567D51+2063697]
      Ordinal0 [0x014720C8+1056968]
      Ordinal0 [0x014A2A59+1256025]
      Ordinal0 [0x014A0D7B+1248635]
      Ordinal0 [0x0149EB4D+1239885]
      Ordinal0 [0x0149D9FD+1235453]
      Ordinal0 [0x014933C7+1192903]
      Ordinal0 [0x014B5973+1333619]
      Ordinal0 [0x014931E6+1192422]
      Ordinal0 [0x014B5A5A+1333850]
      Ordinal0 [0x014C4CAF+1395887]
      Ordinal0 [0x014B583B+1333307]
      Ordinal0 [0x01491F94+1187732]
      Ordinal0 [0x01492DE9+1191401]
      GetHandleVerifier [0x0174F3F6+1531734]
      GetHandleVerifier [0x017FE9AE+2249998]
      GetHandleVerifier [0x016539AB+501003]
      GetHandleVerifier [0x01652A29+497033]
      Ordinal0 [0x0156D11D+2085149]
      Ordinal0 [0x015711C8+2101704]
      Ordinal0 [0x01571302+2102018]
      Ordinal0 [0x0157AA71+2140785]
      BaseThreadInitThunk [0x74FC6A14+36]
      RtlInitializeExceptionChain [0x7777AD8F+143]
      RtlInitializeExceptionChain [0x7777AD5A+90]
  </code></pre>