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

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!
TigerIBDAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
Dave_GreeneCommented:
0
 
wsh2Commented:
<ping>
0
 
TigerIBDAuthor Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Dave_GreeneCommented:
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
 
TigerIBDAuthor Commented:
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
 
TigerIBDAuthor Commented:
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
 
Richie_SimonettiIT OperationsCommented:
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
 
TigerIBDAuthor Commented:
Richie,
Thanks a lot for your input. I will give it try right now. I will let you know the outcome.

Tiger
0
 
TigerIBDAuthor Commented:
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
 
TigerIBDAuthor Commented:
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
 
Richie_SimonettiIT OperationsCommented:
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
 
wsh2Commented:
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

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
Richie_SimonettiIT OperationsCommented:
Works great, well done wsh2!
0
 
TigerIBDAuthor Commented:
Excellent code! Thank you very much.
0
 
TigerIBDAuthor Commented:
many many thanks goes to Richie and wsh2!!!
0
 
Richie_SimonettiIT OperationsCommented:
Many thanks to you for the points!
Cheers
0
 
TigerIBDAuthor Commented:
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
 
LunchyCommented:
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
 
TigerIBDAuthor Commented:
Lunchy, Did you split the points for me already or should I need to do anything else at this point?

Please reply, Thanks.
0
 
TigerIBDAuthor Commented:
Lunchy, I just accepted your proposed solution.
Thanks again.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.