--2mNuWrpDTYoom6W8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > require 'net/http' > h = Net::HTTP.new('test.host.it', 80) > ciao = Array.new > resp, data = h.get('/test.html', nil ) > puts "Code = #{resp.code}" > puts "Message = #{resp.message}" > resp.each {|key, val| printf "%-14s = %-40.40s\n", key, val } > data.each_line { |line| ciao.push($2) if /(href="*(http:\/\/.*?)[>" ]){1,}/ =~ line} > > begin > ciao.each {|line| > resp, data = h.get(line) > p line > } > > rescue Net::ProtoFatalError > print "catched\n" > end Why don't you test the response before you try and read? I don't think you're catching the right exception... or all of them. If you get desperate: include ObjectSpace ObjectSpace.each_object(Exception) do |obj| puts obj.puts end As for your regexp, this is pulled/modified from ruby-tmpl... a tad ugly, but it gets exactly what I need. Iterate over the md to see what you've caught in each paren: pattern = '(<[Aa].*?[Hh][Rr][Ee][Ff]\s*=\s*)(([\'\"])((?:[^#]).*?[^\?]*?){0,1}(\?.*?){0,1}\3)(.*?>)' a_tag_re = Regexp.new(pattern) md = a_tag_re.match(returned_html) i = 0 md.each do |m| puts i + ': ' + m i.succ! end -- Sean Chittenden --2mNuWrpDTYoom6W8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Comment: Sean Chittenden <sean / chittenden.org> iEYEARECAAYFAjuKRwgACgkQn09c7x7d+q3/rgCfZUFQcgNgEliK6xgBpO6wJh4t vrQAn0tfVc/y8iNIN4mWYQCaRqKuw91B Zi -----END PGP SIGNATURE----- --2mNuWrpDTYoom6W8--