Solved

Auto logon to <a href=http://www.investors.com?>www.investors.com?</a>

Posted on 2001-08-01
20
292 Views
Last Modified: 2008-03-10
Hi, experts:

Do you know how to programmatically (VB/VBA/VBS) logon to a web site with Hidden field value?

I need your help to fix my code. I will send you [myLogonID] and [myPassword] if you drop me a line, my e-mail address is TigerIBD@yahoo.com

URL to get to the public login screen is http://www.investors.com/formslogin.asp

************************
my code is: http://www.investors.com/formslogin.asp/verifPwd.asp?htmUserName=myLogonID&htmPassword=myPassword
************************

-----------
You may write a solution based on:
VB or VBS or VBA or Excel Web Query
or Cookie function
or WebBrowser.Navigate
or whatever

Thank you in advance!
0
Comment
Question by:TigerIBD
  • 11
  • 4
  • 2
  • +2
20 Comments
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6342461
0
 
LVL 14

Expert Comment

by:wsh2
ID: 6342585
<ping>
0
 

Author Comment

by:TigerIBD
ID: 6342608
Dave,

Thank you for your prompt response. I just run the Encryption utility you mentioned.

myLogonID becames V6A59CXXXXXXXXXXXXXXXXXXXXXXXXXXXA2679CA13B

and
myPassword becames
V9BEF53XXXXXXXXXXXXXXXXXXXXXXXXXX9D6C68779A70

How do we proceed?

Thanks,
0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6342618
Sorry, to "a" website... I thought this was a site you were working on.  Then you could take in the encrypted values and decrypt them in code.  If this is someone elses site, then this isn't going to get you anywhere
0
 

Author Comment

by:TigerIBD
ID: 6342665
Dave,

Thanks again for your reply. This website is a public accessible website on the Internet with paid subscription. I am an individual investor, I would like to download 50 different companies' stock quote and technical data on the daily basis. That's why I need VB code to save my time.

0
 

Author Comment

by:TigerIBD
ID: 6343266
Here is my e-mail address: TigerIBD@yahoo.com.
If you would like to write a new code, please drop me a line, I will send you myLogonID and myPassword.

Thanks a lot!
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6346016
Give this a shot:
Set areference to microsoft HTML library and Internet controls library on a new project and paste this code in form1:

Option Explicit

Dim WithEvents Ie As InternetExplorer
Private Sub Form_Load()
Set Ie = New InternetExplorer
Ie.Visible = True
Ie.navigate "http://www.investors.com/formslogin.asp"
End Sub


Private Sub Ie_DocumentComplete(ByVal pDisp As Object, URL As Variant)
On Error Resume Next
Dim hdoc As HTMLDocument
Dim txt As HTMLInputElement
Dim btnGo As htmlInputImage

If (pDisp Is Ie) Then
    Set hdoc = Ie.document
    For Each txt In hdoc.All.tags("INPUT")
        If (txt.isTextEdit And txt.Name = "htmUserName") Then
            txt.Value = "username"  'Your choice
        ElseIf (txt.isTextEdit And txt.Name = "htmPassword") Then
            txt.Value = "password" 'Your choice
        End If
    Next
    For Each btnGo In hdoc.body.All
        If (btnGo.Name = "htmPage" And btnGo.Type = "hidden") Then
            btnGo.Click
        End If
    Next
   
End If
End Sub

Hope it helps
0
 

Author Comment

by:TigerIBD
ID: 6346311
Richie,
Thanks a lot for your input. I will give it try right now. I will let you know the outcome.

Tiger
0
 

Author Comment

by:TigerIBD
ID: 6346401
Richie,
You are a very intelligent person. Your program almost gets me there. Can you provide me your e-mail address, so I can send you my userID and password?

Would you please give it a try at your earliest convenient? Thank you in advance.

Tiger
0
 

Author Comment

by:TigerIBD
ID: 6346818
Richie,

Your program almost works except the "btnGo.Click".
------------------------------------------------
If (btnGo.Name = "htmPage" And btnGo.Type = "hidden") Then
    btnGo.Click
End If
------------------------------------------------

Would you please modify the above code? Thanks a lot!  

P.S.  The original website source code is:

<td BGCOLOR="#ffe59a" class="gryformsub"><input type=image alt="Go!" WIDTH="31" HEIGHT="20" src="http://www.investors.com/images/btnGo.gif" border="0" id=image2 name=image2></td>

<td width="1"><img src="http://www.investors.com/px.gif" height="1" width="1" alt="" border="0"></td>

</tr><input name="htmPage" type="hidden" value="http://www.investors.com/default.asp">
-------------------------------------------------
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6346881
Here is my e-mail:
richsimo@hotmail.com
I got the original web source code but i can't try it until tomorrow morning (Here is 8:00 PM now).
I would like to know what is the error with the last section of code (btngo.click).
0
 
LVL 14

Accepted Solution

by:
wsh2 earned 0 total points
ID: 6349160
Assisting Richue_Simonetti:

Set a reference to microsoft HTML library and Internet controls library on a new project and paste this
code in form1:

<----- Code Begin ----->

Option Explicit

Dim WithEvents Ie As InternetExplorer

Private Sub Form_Load()
   
   Set Ie = New InternetExplorer
   Ie.Visible = True
   Ie.Navigate "http://www.investors.com/formslogin.asp"

End Sub

Private Sub Ie_DocumentComplete(ByVal pDisp As Object, URL As Variant)
   
   On Error Resume Next
   Dim hdoc As HTMLDocument
   Dim txt As HTMLInputElement
   
   If (pDisp Is Ie) Then
      Set hdoc = Ie.Document
      If LCase(URL) = "http://www.investors.com/formslogin.asp" Then
         For Each txt In hdoc.All.tags("INPUT")
            Select Case UCase(txt.Name)
               Case "HTMUSERNAME"
                  txt.Value = "Username"  'Your choice
               Case "HTMPASSWORD"
                  txt.Value = "Password" 'Your choice
               Case "IMAGE2"
                  txt.Click
            End Select
         Next txt
      End If
   End If
   
End Sub


<----- Code End ----->



0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6349219
Works great, well done wsh2!
0
 

Author Comment

by:TigerIBD
ID: 6349344
Excellent code! Thank you very much.
0
 

Author Comment

by:TigerIBD
ID: 6349370
many many thanks goes to Richie and wsh2!!!
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6349508
Many thanks to you for the points!
Cheers
0
 

Author Comment

by:TigerIBD
ID: 6349766
Richie and wsh2,

Here comes a new 100-points question for you.

After auto logon to www.investors.com site by using your program. How can you click one button to programmatically save 5 company's technical data to a local computer drive(For example, D:\IBD\) as HTML files.

---------------------
Here are the manual procedures to save [IBD power tools Stock checkup] web page:
1. logon to www.investors.com site
2. at [IBD power tools] area, type in Microsoft stock symbol "msft" without the quotes
3. click Go! button
4. from menu bar, click [File] -- [SaveAs...]
5. type in [d:\ibd\msft] as a File Name
6. click Save button

This saved file becames d:\ibd\msft.html

Repeat this process for the other 4 companies:
INTC       (Intel Company)
DELL       (Dell)
IBM        (IBM)
ORCL       (Oracle)

Thank you very much!
Tiger
0
 
LVL 2

Expert Comment

by:Lunchy
ID: 6350076
I have reduced points to zero for this question so that I can split the points (TigerIBD's CS request.)

wsh2 http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=visualbasic&qid=20163048

Richie_Simonetti http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=visualbasic&qid=20163046
0
 

Author Comment

by:TigerIBD
ID: 6350178
Lunchy, Did you split the points for me already or should I need to do anything else at this point?

Please reply, Thanks.
0
 

Author Comment

by:TigerIBD
ID: 6350232
Lunchy, I just accepted your proposed solution.
Thanks again.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now