If you have a page that looks like this: <a href="http://google.com">google.com</a> <a href="http://facebook.com">facebook.com</a> You can get href attribute of all links with: browser.links.each do |link| puts link.href end When you execute the code, output should be: http://google.com/ http://facebook.com/