From: Paul Lutus Date: 2006-10-06T14:45:11+09:00 Subject: Re: extract relative links from html page cs5b@yahoo.com wrote: > Does somebody have any suggestions on how to extract relative as well > as absolute links from an html page. It seems like the URI.extract only > matches on absolute urls. Roll your own, a classic piece of programming advice: #!/usr/bin/ruby -w data = File.read("/path/page.html") data.scan(/src\s*=\s*\"(.*?)\"/im) { |item| puts "src = #{item}\n" } data.scan(/href\s*=\s*\"(.*?)\"/im) { |item| puts "href = #{item}\n" } -- Paul Lutus http://www.arachnoid.com