PC Review


Reply
Thread Tools Rate Thread

Can you check if a site requires a login and if so, close IE?

 
 
CK
Guest
Posts: n/a
 
      29th Oct 2007
I have this code. Is there anyway to determine is a site requires a login
and if so, do not display that page? Close the browser? Otherwise I have to
click cancel. Is this possible? Sorry for the cross post. I wasn't sure
where this belonged.
Thanks in advance,
~ck

'********** Example Code ************

OpenWebSites
WScript.echo "Done"
WScript.quit


Sub OpenWebSites
Dim objHTML
Dim sUrls
Dim sBody
Const DELIMITER = ","

sUrls =
Split("https://mail02.innovasi.com/exchange,http://www.google.com",DELIMITER)
Set objHTML = CreateObject("InternetExplorer.Application")
For j = 0 To UBound(sUrls)
objHTML.Visible = True
objHTML.Navigate(sUrls(j))

while objHTML.ReadyState <> 4
WScript.sleep 50
wend

sBody = objHTML.Document.body.innerText
WScript.echo sBody
Next


End Sub

'********* End Code ************




 
Reply With Quote
 
 
 
 
Paul Randall
Guest
Posts: n/a
 
      30th Oct 2007
Hi,
There are a number of ways to do this, but no magic bullet that recognizes
the things you want to skip. It looks like your code displays the web page
and then puts the text of the body of the HTML into a string variable. Why
not put the the body's innerHtml into a string variable and look at it to
see what the password code (or the invalid logon screen) looks like. Then,
change your code to go on to the next URL whenever similar code shows up in
a page.

If you are not familiar with HTML, it might be a little difficult to figure
out. For learning purposes, you might download and run a freebee HTMLEditor
download from Microsoft. Learn about this simple HTML editor at:
http://msdn2.microsoft.com/en-us/library/ms537834.aspx;

Download it at:
http://msdn.microsoft.com/archive/de...or/default.asp

To use it, go to one of the password-requiring URLs, select some part of the
screen that indicates you want to skip it, and paste it into the
HTML_Editor.hta window. Use its File menu to save it to a file. View that
saved file in a text/html/script editor, and you should have just a small
amount of HTML code to figure out.

-Paul Randall

"CK" <(E-Mail Removed)> wrote in message
news:nRsVi.15824$(E-Mail Removed)...
>I have this code. Is there anyway to determine is a site requires a login
>and if so, do not display that page? Close the browser? Otherwise I have to
>click cancel. Is this possible? Sorry for the cross post. I wasn't sure
>where this belonged.
> Thanks in advance,
> ~ck
>
> '********** Example Code ************
>
> OpenWebSites
> WScript.echo "Done"
> WScript.quit
>
>
> Sub OpenWebSites
> Dim objHTML
> Dim sUrls
> Dim sBody
> Const DELIMITER = ","
>
> sUrls =
> Split("https://mail02.innovasi.com/exchange,http://www.google.com",DELIMITER)
> Set objHTML = CreateObject("InternetExplorer.Application")
> For j = 0 To UBound(sUrls)
> objHTML.Visible = True
> objHTML.Navigate(sUrls(j))
>
> while objHTML.ReadyState <> 4
> WScript.sleep 50
> wend
>
> sBody = objHTML.Document.body.innerText
> WScript.echo sBody
> Next
>
>
> End Sub
>
> '********* End Code ************
>
>
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RPC requires a double login Bytemi Microsoft Outlook Discussion 1 4th Dec 2009 04:15 PM
Determine if a site requires login, if so close browser CK Windows XP Internet Explorer 0 29th Oct 2007 10:00 PM
Standby requires a login Paul B Windows XP General 2 13th Mar 2007 08:39 PM
Outlook requires login again =?Utf-8?B?Q2xhaXJlVmlldw==?= Microsoft Outlook Discussion 3 1st Feb 2007 06:56 PM
Site requires ActiveX - Help! =?Utf-8?B?c3Bhcms3OQ==?= Windows XP Internet Explorer 1 30th Nov 2004 08:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:21 AM.