href does not want to get printed although I followed the path

I want to enter a link in a webpage. This is its location in the inspect element:
enter image description here
As You can see, to reach the link in the < body >, I have to pass through:

1) < div class = “container” >

2) < div id = “result content >

3) < div class=”tabbable tabs-left” >

4) < ul class =”nav… >

There are many < li >, typically I want to collect the hrefs of the class visible phone. The code I have does not prints nothing. What am i doing wrong??

agent =
page = agent.get('')
array ='//body/div[@id="result-content"]/div[@class="tabbable tabs-left"]/ul[@class="nav nav-tabs"]/li[@class="visible-phone"]/a').each do |x|
    puts x['href']

Source: ruby

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.