- To: mathgroup at smc.vnet.net
- Subject: [mg111682] Re: ExistsURLQ
- From: E. Pérez Herrero <enriqueperezherrero at gmail.com>
- Date: Tue, 10 Aug 2010 03:55:27 -0400 (EDT)
- References: <email@example.com> <firstname.lastname@example.org>
On 9 ago, 11:11, Simon <simonjty... at gmail.com> wrote:
> maybe something like the following?
> In:= ExistURLQ["http://www.google.com/"]
> Out= True
> In:= ExistURLQ["http://a.non.site/"]
> Out= False
> In:= Import["http://www.google.com/","Elements"]
> On Aug 8, 9:21 pm, E. P=E9rez Herrero <enriqueperezherr... at gmail.com>
> > Hello everybody:
> > I'm trying to find the best way to test if any internet link is
> > available or not, something similar to FileExistsQ, but with a web
> > URL.
> > As I could not find anything about this topic on the documentation, I
> > 've been rewieving some internal packages and the idea I had is this
> > one:
> > << Utilities`URLTools`
> > (*This is a failed link *)
> > Quiet[If[(ToString[Head[Utilities`URLTools`FetchURL["http://www.googeewrtwertwetrerle23232.es/", "file.tmp"]]] ==
> > "Symbol"), Print["Failed"], Print["Ok"]]];
> > (*And this is a good one*)
> > Quiet[If[(ToString[
> > Head[Utilities`URLTools`FetchURL["http://www.google.es/",
> > "file.tmp"]]] == "Symbol"), Print["Failed"], Print["Ok"]]]
> > The idea is to use the FecthURL function that cames within the
> > "URLTools" package, but this way of doing this seems awful and this
> > function creates a temporary file that after all it is necessary to be
> > deleted.
> > Does anybody knows the proper way to do this?
> > Thanks in advance.
> > Enrique.- Ocultar texto de la cita -
> - Mostrar texto de la cita -
Simon I'm going to use your code, because it is better than mine.
Thank you all, but don't you think that Mathematica should include
this kind of function?
Thank you all
Prev by Date:
Re: remote kernel problem
Next by Date:
Re: A new graphic user interface
Previous by thread:
Next by thread: