title: How to find all elements containing the word "download" using Selenium x-path?
body: <p>I'm using Selenium to do some webscraping and I now want to find all elements on which the user can click and which contain the word "download" (in any capitalization) in either the link text, the button text, the element <code>id</code>, the element <code>class</code> or the <code>href</code>. This can include both links, buttons or any other element.</p>
  
  <p>In <a href="https://stackoverflow.com/a/18701085/1650012">this answer</a> I found the an xpath for somebody looking for an xpath to search for buttons based on a certain text (or non-case-sensitive and partial matches):</p>
  
  <pre><code>text = 'download'
  driver.find_elements_by_xpath("(//*[contains(text(), 'download')]")
  </code></pre>
  
  <p>but on <a href="https://www.yourticketprovider.nl/LiveContent/tickets.aspx?x=492449&amp;y=8687&amp;px=92AD8EAA22C9223FBCA3102EE0AE2899510C03E398A8A08A222AFDACEBFF8BA95D656F01FB04A1437669EC46E93AB5776A33951830BBA97DD94DB1729BF42D76&amp;rand=a17cafc7-26fe-42d9-a61a-894b43a28046&amp;utm_source=PurchaseSuccess&amp;utm_medium=Email&amp;utm_campaign=SystemMails" rel="nofollow noreferrer">this page</a> that returns no results, even though the following link is in there:</p>
  
  <pre><code>&lt;a id="downloadTop" class="navlink" href="javascript:__doPostBack('downloadTop','')"&gt;Download&lt;/a&gt;
  </code></pre>
  
  <p>Does anybody know how I can find all elements which somehow contain the word "download" in a website?</p>
  
  <p>[EDIT]
  This question was marked as a duplicate for a question which gets <a href="https://stackoverflow.com/a/3655588/1650012">an answer</a> in which it is suggested to change it to <code>"//*[text()[contains(.,'download')]]"</code>. So I tried the following:</p>
  
  <pre><code>&gt;&gt;&gt; from selenium import webdriver
  &gt;&gt;&gt; d = webdriver.Firefox()
  &gt;&gt;&gt; link = 'https://www.yourticketprovider.nl/LiveContent/tickets.aspx?x=492449&amp;y=8687&amp;px=92AD8EAA22C9223FBCA3102EE0AE2899510C03E398A8A08A222AFDACEBFF8BA95D656F01FB04A1437669EC46E93AB5776A33951830BBA97DD94DB1729BF42D76&amp;rand=a17cafc7-26fe-42d9-a61a-894b43a28046&amp;utm_source=PurchaseSuccess&amp;utm_medium=Email&amp;utm_campaign=SystemMails'
  &gt;&gt;&gt; d.get(link)
  &gt;&gt;&gt; d.find_elements_by_xpath("//*[text()[contains(.,'download')]]")
  []  # As you can see it still doesn't get any results..
  &gt;&gt;&gt;
  </code></pre>
  
  <p>Does anybody know how I can get all elements on which the user can click and which contain the word "download" in either the link text, the button text, the element <code>id</code>, the element <code>class</code> or the <code>href</code>? All tips are welcome!</p>