Opening web pages

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
zopita
Newbie
Posts: 19
Joined: Wed Feb 18, 2009 5:45 pm
Location: Spain

Opening web pages

Post by zopita » Fri Jul 03, 2009 8:07 pm

Hi!

I must open some web pages and make some task.

So my macro goes to Word, copy an URL, goes to Internet Explorer, paste the URL, Enter .......... I would like inclure just after Enter an If command for abort the macro when the web page couldn't be open.

¿Does someone help me? ¡Thanks!

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Check if webpage can be loaded using HTTPRequest

Post by adroege » Thu Jun 03, 2010 8:25 pm

Try something like the following

[code]
Let>HTTP_TIMEOUT=10

//URL of webpage to check
Let>URL=http://www.myj3-33u345n-2k3.com

HTTPRequest>URL,,GET,,HTMLResponse
//Some DNS servers return a special error page if the URL
//is not found -- if this is the case checking for 404 Error
//will not work. On my connection this works just fine

If>HTMLResponse=404 Error connecting to host
MessageModal>This webpage will not load
Else
MessageModal>This webpage is fine
Endif

[/code]

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts