title: click link with particular text in selenium
body: <p>I have tried a few things such as this:</p>
  
  <pre><code>IWebDriver driver = new ChromeDriver(@"D:\Selenium");
  driver.Navigate().GoToUrl("http://www.bladibla.com");
  
  ReadOnlyCollection&lt;IWebElement&gt; elements = driver.FindElements(By.TagName("a"));
  foreach (IWebElement element in elements)
  {
      if (element.Text.Equals("Bla"))
      {
  
      }
      Console.WriteLine(element.Text);
  }
  </code></pre>
  
  <p>Including some XPath without success. All I want is click the link represented by this html:</p>
  
  <pre><code>&lt;a href="xyz/bla.txt" onclick="ga('send', 'pageview', 'xyz/bla.txt');"&gt;&lt;img src="images/download16.png" alt="Download XYZ" /&gt;Bla&lt;/a&gt;
  </code></pre>
  
  <p>Any help would be very much appreciated. Thanks.</p>
  
  <p>PS:</p>
  
  <p>Current code:</p>
  
  <pre><code>using System;
  using OpenQA.Selenium;
  using OpenQA.Selenium.Chrome;
  
  namespace Selenium
  {
      class Program
      {
          static void Main(string[] args)
          {
              try
              {
                  IWebDriver driver = new ChromeDriver(@"D:\Selenium");
                  driver.Navigate().GoToUrl("http://www.doogal.co.uk/UKPostcodes.php?Search=AB1");
  
                  var test = driver.FindElement(By.CssSelector("a[href^='UKPostcodesKML']"));
  
                  driver.Close();
              }
              catch (Exception e)
              {
  
                  throw;
              }
          }
      }
  }
  </code></pre>