Solved

Logon to web page using given Username and password

Posted on 2003-12-05
12
368 Views
Last Modified: 2010-05-03
This doesn't have to be a VB app, any solutions greatly appreciated. I have a logon to a particular site. What I need is to navigate to this particular site, automatically enter my password and user name and press the submit button. After that to navigate down this page press a link to download a file and accept. Im sure this can be done using SendKeys amongst other things but really Im not sure.

0
Comment
Question by:pbehan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
12 Comments
 
LVL 9

Expert Comment

by:Dang123
ID: 9882199
pbehan,
    Here is sample code I got here on EE, I don't remember where now. This will let you enter your user name and password, and login.

    Set oIE = CreateObject("InternetExplorer.Application")
    oIE.Visible = True
    oIE.Navigate ("www.hotmail.com")
    While oIE.Busy: Wend ' wait for page to load...
    oIE.Document.All("login").Value = "USERID"
    oIE.Document.All("passwd").Value = "PASSWORD"
    oIE.Document.Forms(0).Submit

(you will need to look at the source html to get the names used for username {"login"} and password {"passwd"} boxes and adjust the code.)

Dang123


0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 250 total points
ID: 9882490
0
 
LVL 9

Expert Comment

by:Dang123
ID: 9883067
Richie_Simonetti,
    Yes, I think it was one of your posts. Thanks. (Though the angelfire link always comes up as blocked for me.)
Dang123

0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9883415
Strange, i haven't that problem in any of computers that i did access it.
Don't worry, it is not my code: i would never use this line

While oIE.Busy: Wend ' wait for page to load...

since Busy and Readystate are a little buggy.
0
 
LVL 9

Expert Comment

by:Dang123
ID: 9883916
Richie_Simonetti,
    It is a setting on our firewall, sites that are filtered out by the service we subscribe to just come back with a big red hand. My group doesn't have anything do with it so . . .   : (    What do you prefer to replace the while busy?



pbehan,
    The code samples you have now will get you loged in, you should be able to expand it with

oIE.Navigate(

to start the file download.



Dang123

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9883976
Since a declared IE variables with withevents keywords i could access documentcomplete event of IE (Webbrowser control too!)

This event only is fired when document is completely downloaded, so it is easy to access DOM from HTMLDocument inside the browser.
Just a piece of advise:
DocumentComplete event fires for ALL and EACH document if there are frames at the URL.
To manage this, i always use (even if i know that there are no frames):

if (pDisp is ie) then
    ' code to access document goes here
end if

pDisp is IE  is only True when ALL documents were fully downloaded.
hope it helps.
0
 
LVL 9

Expert Comment

by:Dang123
ID: 9883998
Thanks for the tip Richie_Simonetti. I'm sure it will come in handy.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9884007
"...
....
After that to navigate down this page press a link to download a file and accept. Im sure this can be done using SendKeys amongst other things but really Im not sure.
....
....
"

To know where you are (in which page), i use to test the URL paramater, if it is logon page, i would execute logon code, if logon is successfull, you would know which is the correct url then do the click in the desired link, or better, if you already know the link just use code some like this:

if url="your _choice_where _are_the_links" then
      ie. navigate "http://www.domain.com/filename.xyz"
end if
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9884024
Sorry may be I should not say it.

It is a really handy program to guess someone else password from the web
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9884028
Don't take it seriously.

8->
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9884059
Only if you manage BeforeNavigate event and usr/pwd is already wrote, so accessing doument object, you could check for
msgbox oIE.Document.All("password").Value
but i never tried.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question