I want to run a check to see which pages have forms and which ones don't
from a file with url's. I'm using the size of the form to make that
determination. But after I get to the 13 url in the file I get an error
and the script exists. Does anyone know why?
f = File.open("eliminate.txt")
noformfile = File.new("noform.txt", "w+")
formfile = File.new("form.txt" , "w+")
agent = WWW::Mechanize.new
begin
while (line = f.readline)
page = agent.get(line)
forms = page.forms
if forms.size > 0 then
formfile.puts line
else
noformfile.puts line
end
end
rescue EOFError
puts "error"
end
--
Posted via http://www.ruby-forum.com/.