Jump to content

Logging it to site using VB


Recommended Posts

Hello,

I am writing a simple VBS script that should, as one of its functions, open IE, go to a certail website and log user on to it with username and password saved within the script (password does not have to be encrypted in any way as the only purpose of the script is automation and it will be used by a single user only).

So far I 've got somthing like this:

Set wshShell = WScript.CreateObject ("WSCript.shell")

Set IE = CreateObject("InternetExplorer.Application")

IE.visible = 1

IE.navigate ("<logon website address>")

The username and password for the website is not the same as credentials for Windows domain logon.

Any help much appriciated... :)

Link to comment
Share on other sites


It's not working for this particular website, thanks though.

Tried to get the script to find 'input' fileds and fill them out but got lost as could not get names of the filedsfrom the site and finally managed to log in using 'wshshell.sendkeys' which is kind of primitive...

Maybe you can advise something more universal?

Thanks in advance.

Link to comment
Share on other sites

That only works for sites using basic authentication (most aren't these days).

For other sites, you have to know in advance the url the login http form posts to (which you'd find out by looking at the page source), you need to know which fields are on the said page (varies from a site to another), you'll also have to url encode the login & password (in case they contain "special" chars), then finally you make the http post using a XMLHttpRequest object.

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...