A
A
A_Modestov2016-06-26 17:44:55
css
A_Modestov, 2016-06-26 17:44:55

How to access html element one level up using Capybara?

Good afternoon, ladies and gentlemen. There was such a problem.
We have html:

<a class="_5pcq" href="..." target="">
  <abbr title="..." class="_5ptz timestamp livetimestamp"></abbr>
</a>

With the help of Capybara I get an array of elements of the class " _5ptz" : get the corresponding element "_5pcq"
post_dates = session.all("abbr._5ptz")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2016-06-27
@A_Modestov

Try node.find(:xpath, "..")
or
parent . It?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question