From: Michael Fellinger Date: 2008-09-11T21:34:13+09:00 Subject: Re: How to check if a webpage exists On Thu, Sep 11, 2008 at 6:55 PM, Davide Benini wrote: > Ok folks, I probably see what's wrong. > The latest example works > > begin > puts open("http://www.does.not.exist.sdadasdas.com",:proxy=>true).read > p "i'm ok" > rescue => e > p "sorry can't do" > p "error is: #{e}" > end > > I get "sorry can't do" "error is: 400 Bad Request". > > But if I do this > > begin > puts open("http://www.jhkhjhkj.com",:proxy=>true).read > p "i'm ok" > rescue => e > p "sorry can't do" > p "error is: #{e}" > end > I get > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> xmlns="http://www.w3.org/1999/xhtml">