How to get attribute value of an element with PHP Behat?

Can I get the attribute value of an element with PHP Behat?

Hi Mark,

Refer to the following code snippet, that will help you fetch attribute value of an element:

$el = $page->find('css', '.something');

if ($el->hasAttribute('href')) {
    echo $el->getAttribute('href');
} else {
    echo 'This anchor is not a link. It does not have an href.';
}