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
First I tried my luck with
if page = Hpricot( open(url))
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
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,