D
Davide Benini
This probably is trivial, but I have been googling for almost 2hs
without finding a viable solution.
Basically I have this rails app which uses hpricot to parse web pages.
There's this line
page = Hpricot( open(url))
If the url is wrong, or the server is down, obviously I get an
exception.
First I tried my luck with
if page = Hpricot( open(url))
blah blah
end
but this did not work.
Then I started googling like crazy for a method to check if a webpage is
loadable. I only found this thread
http://markmail.org/message/iurqf4ejbndbczqq
I tried the suggested code, it does not work.
Now, I am pretty sure there's a straightforward way of checking whether
a webpage is loadable.
Can you help me?
Thanks in advance,
Davide
without finding a viable solution.
Basically I have this rails app which uses hpricot to parse web pages.
There's this line
page = Hpricot( open(url))
If the url is wrong, or the server is down, obviously I get an
exception.
First I tried my luck with
if page = Hpricot( open(url))
blah blah
end
but this did not work.
Then I started googling like crazy for a method to check if a webpage is
loadable. I only found this thread
http://markmail.org/message/iurqf4ejbndbczqq
I tried the suggested code, it does not work.
Now, I am pretty sure there's a straightforward way of checking whether
a webpage is loadable.
Can you help me?
Thanks in advance,
Davide