I try to make a WebCrawler which find links from a homepage and visit the found links again and again.. Now i have written a code w9ith a parser which shows me the found links and print there statistics of some tags of this homepage but i dont get it how to visit the new links in a loop and print there statistics too.
*
@visit = {}
@src = Net::HTTP.start(@url.host, @url.port) do |http|
http.get(@url.path)
@content = @src.body
*
def govisit
if @content =~ @commentTag
end
cnt = @content.scan(@aTag)
cnt.each do |link|
@visit[link] = []
end
puts "Links on this site: "
@visit.each do |links|
puts links
end
if @visit.size >= 500
exit 0
end
printStatistics
end