title: Python selenium xpath using contains and not contains
body: <p>I try to get links whose title contains some word in the mean time not contains some words, I use the following code but it says is not a valid XPath expression.</p>
  <p>Please find my code here:</p>
  <p>Any help will be highly appreciated!</p>
  <pre><code>driver.get(&quot;http://www.csisc.cn/zbscbzw/isinbm/index_list_code.shtml&quot;)
  while True:
      links = [link.get_attribute('href') for link in driver.find_elements_by_xpath(&quot;//a[(contains(@title,'公司债券')and not(contains(@title,'短期'))]&quot;)]
      for link in links:
                 driver.get(link)
                 #dosth
  </code></pre>