Answer the question
In order to leave comments, you need to log in
Why in copybara and poltergeist, after entering the page in a cycle, I can’t go to the next element?
Greetings!
There is a page with a list of links that you need to go through, go to each one, do something there (maybe also follow the link on it). The problem is that after going through the first link, the next one does not go any more.
url1 = '....'
@browser = Capybara.current_session
@browser.visit url1
@browser.all '.registerBox table'.each do |item|
link_on_uid = item.first '.descripTd dt a'
url2 = link_on_uid['href']
puts url2
@browser.visit url2
@browser.all('.boxWrapper>table>tbody>tr').each do |tr|
.....
end
puts 123
end
Answer the question
In order to leave comments, you need to log in
Capybara is completely similar to the user's actions. Try to repeat with your hands. As soon as you click on the first link, a new page will open, on which there will no longer be the original list of links.
It is convenient for capybara to use save_and_open_page method for debugging
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question