Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
mechanize timeout errors
akanksha.baid
8/8/2006 6:42:00 PM
I am using mechanize for scraping some urls.
begin
page = agent.get(url)
rescue
puts "oops!!"
end
catches invalid urls etc. , but how to I handle timeout errors?
In particular this is the error I get :
request-header: accept => */*
request-header: user-agent => WWW-Mechanize/0.5.1
(
http://rubyforge.org/projects/...
)
/usr/local/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired
(Timeout::Error)
from /usr/local/lib/ruby/1.8/timeout.rb:56:in `timeout'
from /usr/local/lib/ruby/1.8/timeout.rb:76:in `timeout'
Could someone also point me to some urls that always timeout. I tried
writing an inifinite while loop to simulate similar timeout erros, but
that did not work (or maybe I hit Ctrl C too soon).
Appreciate the help. Thanks!
Akanksha
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
mechanize timeout errors
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password