Subscribe Bookmark RSS Feed

How can I check to see if a website exists before receiving an error?

chadw

Community Trekker

Joined:

Jul 9, 2014

I am trying to create a script that will pull data from different websites.  I would like to test if a website exists and if not, then move on to another website.  With my current code, if the site does not exist I get a pop up error reading, "Cannot open table in access or evaluation of 'Open' , Open( Full_EI_WEB_Sites[1], invisible, HTML Table( 1 ) )".

Is there something similar to the File Exists() function, but for opening websites?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Maybe try the Try(expr, catch expr) function. If the second argument is not included, then the script just runs when the expression throws an error.

bad=expr(dt1=open("not a file.txt"));

good=expr(today());

try(bad,show("bad ran"));

try(good,show("good ran"));

2 REPLIES
Solution

Maybe try the Try(expr, catch expr) function. If the second argument is not included, then the script just runs when the expression throws an error.

bad=expr(dt1=open("not a file.txt"));

good=expr(today());

try(bad,show("bad ran"));

try(good,show("good ran"));

chadw

Community Trekker

Joined:

Jul 9, 2014

Sorry for the late reply.  The Try() function worked perfectly! 

Thanks for the help,

Chad