title: Capybara: is it possible to get an attribute value from a css string?
body: <p>If I've got some HTML like:</p>
  
  <pre><code>&lt;div id='drawer'&gt;&lt;ul&gt;&lt;li&gt;&lt;a href='www'&gt;description&lt;/a&gt;...
  </code></pre>
  
  <p>I've seen that I can get the value of href in Capybara with:</p>
  
  <pre><code>page.find('div#drawer a')['href']
  </code></pre>
  
  <p>But is there any way to retrieve that value if it's completely described as a css string? ie, trying to get the value for <strong>'div#drawer a[href]'</strong> </p>
  
  <p>I've tried with expressions like this:</p>
  
  <pre><code>page.find('div#drawer a[href]')        =&gt; can't convert Capybara::Node::Element into String (TypeError)
  page.find('div#drawer a[href]').value  =&gt; can't convert nil into String (TypeError)
  page.find('div#drawer a[href]').text   =&gt; returns the text value of 'description'
  </code></pre>
  
  <p>I've got that css expression in an external config file, so would it be possible somehow to just use it directly and retrieve the value of the attribute in question?</p>
  
  <p>Thank you...    </p>