Capybaraで<a>タグのhref属性を取得するには、page.find('div#drawer a')[:href]

k_oshimak_oshima のブックマーク 2015/04/16 15:16

その他

このブックマークにはスターがありません。
最初のスターをつけてみよう!

Capybara: is it possible to get an attribute value from a css string?

    If I've got some HTML like: <div id='drawer'><ul><li><a href='www'>description</a>... I've seen that I can get the value of href in Capybara with: page.find('div#drawer a')['href'] But is there any...

    \ コメントが サクサク読める アプリです /

    • App Storeからダウンロード
    • Google Playで手に入れよう