From: Tim Hunter Date: 2007-09-19T02:44:38+09:00 Subject: Re: check for active web pages with open-uri Chuck Dawit wrote: > I'm using openuri module to open web pages. If the pages doesn't exist I > get an error: > in `initialize': getaddrinfo: no address associated with hostname. > (SocketError) > > then I get a whole bunch of other stuff. Is there a parameter to use so > that open() returns a true or false value if the page exists or not? > Basically I'm looking through a list of web addresses and I want to > store the active pages and throw away the non active pages. So if the > page doesn't exist I want to be able to move on in the script. Why not use rescue to catch the SocketError? -- Posted via http://www.ruby-forum.com/.