title: Selenium: How to find element by partial href?
body: <p>Working code 1:</p>
  
  <pre><code>Driver.Instance.FindElement( By.XPath("//a[contains(@href,'" + PartialLinkHref + "')]" ));
  </code></pre>
  
  <p>Working code 2:</p>
  
  <pre><code>ReadOnlyCollection&lt;IWebElement&gt; linkList = Driver.Instance.FindElements(By.TagName("a"));
  for (int i = 0; i &lt; linkList.Count ; i++)
  {
       if (linkList[1].GetAttribute("href").Contains(PartialLinkHref))
       {
            element.SetElement(linkList[i]);
            return element;
            break;
       }
  }
  </code></pre>