From: Sybren Kooistra Date: 2012-10-02T23:26:24+09:00 Subject: Re: Ruby Mechanize and do-if loops Thanks! Should work.. So why is not working for me? agent = Mechanize.new agent.get("http://www.miljoenhuizen.nl/houses/nl/1000/0/99999999/-/pg1?searchtype=archive") loop do pagina = agent.page links = pagina.search("//td[@class = 'upper']/a") open('postcode.txt', 'a') { |f| f.puts links } next_link = agent.page.link.with(:text => 'Next >') break unless next_link next_link.click end ?? -- Posted via http://www.ruby-forum.com/.