Monthly Archives: April 2007

Snap a URL with http authentication.

Some times a URL is protected by autentication scheme such as http authentication or NTLM if you are in a windows domain network. It ususally asks user to input username and password so as to access the protected URLs by poping up a dialog.

Our  Htmlsnapshot now supports authentication URLs with a method called SetAuthUserAndPasswd

‘demo how to capture a page with http authentication
Dim snap

‘Create the Html Snapshot Object
Set snap = CreateObject(“HTMLSNAP2.HtmlSnap.1″)

‘Set the time to wait for web page loading
snap.SetTimeOut CLng(200000)

‘Begin to capture the web page
‘Note, change following to your url, user and password for test
snap.SetAuthUserAndPasswd “username”, “password”

snap.SnapUrl ““, “auth.jpg”

‘Free object
Set snap = Nothing