I'm trying to save the links only of the sample pages in this website MusicRadar
require 'open-uri'
require 'nokogiri'
link = 'https://www.musicradar.com/news/tech/free-music-samples-royalty-free-loops-hits-and-multis-to-download'
html = OpenURI.open_uri(link)
doc = Nokogiri::HTML(html)
#used grep because every sample link in that page ends with '-samples'
doc.xpath('//div/a/@href').grep(/-samples/)
The problem is that it only finds 3 of that links What am I doing wrong? And If i wanted to open each of that links?