I have a page-internal link in an html page:
<div class="bar">
<a href="#foo">Go to foo</a>
</div>
I selected this anchor element using Capybara matcher. When I try to access the href
attribute, the value is expanded to full URL:
find(".bar a")[:href] # => "http://path/to/page#foo"
How can get only the internal link, i.e., the verbatim href value?
find(".bar a")... # => "#foo"