title: Python Selenium SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//div[contains(@class, 'product-card__subtitle')
body: <p>Trying to get the XPath of div class and the text inside of the div. the two divs are:</p>
  <pre><code>&lt;div class=&quot;product-card__subtitle&quot;&gt;Women's Shoe&lt;/div&gt;
  &lt;div class=&quot;product-card__subtitle&quot;&gt;Men's Shoe&lt;/div&gt;
  </code></pre>
  <p>My Xpaths that are giving the selenium error are:</p>
  <pre><code>driver.find_element_by_xpath(&quot;//div[contains(@class, 'product-card__subtitle') and text(&quot;
                                                        &quot;)='Women's Shoe']&quot;)
  
  driver.find_element_by_xpath(&quot;//div[contains(@class, 'product-card__subtitle') and text()='Men's &quot;
                                                      &quot;Shoe']&quot;)
  </code></pre>
  <p>I am trying to get the path for the part that says &quot;Women's shoe&quot; and another path for the part that says &quot;Men's shoe&quot;
  <a href="https://i.stack.imgur.com/gmLsV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gmLsV.png" alt="pic" /></a></p>