title: Click on part of text in a span tag watir
body: <p>I have this html code:</p>
  
  <pre><code>&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td class=message&gt;
        &lt;div class=div10l&gt;Fill In All Fields With&lt;IMG style="CURSOR: hand" border=0 alt="Not  Null" src="../img/re.gif"&gt;.&lt;/div&gt;
        &lt;span style="COLOR: red"&gt;
          &lt;a href="../main/Error.jsp" target=_blank&gt;
            &lt;span style="COLOR: red"&gt;Exception: ERROR: duplicate key value&lt;/span&gt;
          &lt;/a&gt;
          &lt;br&gt;
        &lt;/span&gt;
        &lt;br&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p>If there is error on the page I get the message Exception: ERROR: duplicate key value, which is the link for a detailed explanation. How can I click on this text using only part of text - Exception? </p>
  
  <p>I tried ie1.span(:text => /Exception: ERROR:/).click, but the link isn't opened.</p>
  
  <p>If I try ie1.link(:href, "../main/Error.jsp").click - I get the following:</p>
  
  <pre><code>can't find the object - 
  E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/element.rb:66:in `assert_exists': Unable to locate element, using {:tag_name=&gt;["a"], :href=&gt;"../main/Error.jsp"} (Watir::Exception::UnknownObjectException)
      from E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/element.rb:414:in `perform_action'
      from E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/element.rb:269:in `click!'
      from E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/element.rb:211:in `click'
      from file1.rb:53:in `&lt;main&gt;'
  </code></pre>