I need to make a code that reads me web pages, and that incidentally collects the re-address links and copies what they have inside, it's in ruby
require 'net/http'
pagina = Net::HTTP.get(ARGV[0],ARGV[1])
puts "...Leyendo la pagina....\n#{pagina}\n=========\n"
ahref = "<a href"
cierra ="</a>"
startahref = pagina.gsub(ahref)
cierraahref = pagina.gsub(cierra)
img = "<img"
cierra2 = ">"
startimg =pagina.gsub(img)
cierraimg = pagina.gsub(cierra2)
puts startahref
puts "<a href...</a> cantidad : "
ahref2 = startahref..cierraahref
puts pagina[ahref2]
puts "<img ...> cantidad :"
img2 = startimg..cierraimg
puts pagina[img2]