Question for Richie Simonetti, wsh2 and Dave Greene?

Richie/wsh2/Dave,

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(such as 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
TigerIBDAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Richie_SimonettiConnect With a Mentor IT OperationsCommented:
The code posted (And for those "attributes") need tobe saved as an "complete" form to work. I mean, that not was only code but an entire form.

I didn't understand "25 symbols" stuff :0

Here is the complete code as it was compiled:

' code begins.........
Option Explicit
Dim WithEvents Ie As InternetExplorer
Sub form_load()
With cboSymb
    .AddItem "MSFT" '(Microsoft)
    .AddItem "INTC" '(Intel Company)
    .AddItem "DELL" '(Dell)
    .AddItem "IBM"  '(IBM)
    .AddItem "ORCL" '(Oracle)
    .ListIndex = 0
End With

Set Ie = New InternetExplorer
With Ie
    .Visible = True
    .navigate "http://www.investors.com/formslogin.asp"
End With
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
        cmdGo.Enabled = True
      Else
        If InStr(1, URL, cboSymb.Text, vbTextCompare) Then
            GetStock hdoc.body.innerHTML
        End If
      End If
  End If
 
End Sub



Sub GetStock(symbol As String)
Dim ff As Integer
ff = FreeFile
Open "d:\ibd\" & cboSymb.Text & ".htm" For Output As #ff
  Print #ff, symbol
Close #ff
End Sub

Private Sub cmdGo_Click()
Ie.navigate "http://www.investors.com/member/checkup/checkUp.asp?t=" & UCase$(cboSymb.Text) & "&sp="
End Sub
'........code ends.

Cheers.
0
 
Dave_GreeneCommented:
Just a comment.  Some sites allow you to enter multiple tickers delimited by either a space (most common) or a comma (less common).  I would try it, may save you some work.

Cheers!
Dave
0
 
TigerIBDAuthor Commented:
Dave,
First of all, I would like to thank you here for your early input on auto-logon program.

Regarding the multiple tickers, it is not possible at this web site. Simply, each ticker page contains more than 50 different technical data. It is not a simple price quote screen such as listing at http://quote.yahoo.com.

If you drop me a line at TigerIBD@yahoo.com, I will send you myUserID and password, you can give a shot.

Thanks again,
Tiger
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Richie_SimonettiIT OperationsCommented:
You don't get anything else from me, sorry.
0
 
Dave_GreeneCommented:
Richie,

He'll do right by ya...  I'll give you points if he won't..  Just stay in the game!
0
 
TigerIBDAuthor Commented:
Richie,
I am new on EE. Before I receive your response, I already send e-mail to Community Support to credit 75-Points to you and wsh2.

I am still learning this game.
Tiger
0
 
TigerIBDAuthor Commented:
Richie,

Community Support asked me to split points for this question. Here is my answer.

50-points to you and 25-points to wsh2.

I just wish at times when we selected the question's answers. We had an option to select multiple experts at the same time as Points receivers.

Regards,
Tiger


0
 
TigerIBDAuthor Commented:
For the record, here is the response from Community Support:
----------------------------
You have already awarded that question to wsh2.  What I will do is create another question for Richie
Simonetti and award him some points as well.  In the future, do not accept an answer before requesting
a point split.
----------------------------
Therefore, the split what I posted above isn't going to work. Regardless, Richie and wsh2 both deserve my 75 points.

Regards,
Tiger
0
 
Richie_SimonettiIT OperationsCommented:
Dave, you are  a nice person. This not a points matter. What're points anyway!, i can't eat them, neither buy something with them, nor upgrade my way of life.
It a matter of a job done or not (mostly).
Cheers.
By the way, i think that site stores sessions with cookies, so if we could know which is the string send to asp page you could use Inet control to retrieve those pages.
0
 
Dave_GreeneCommented:
That's a good place to start..
0
 
TigerIBDAuthor Commented:
Richie,

I want to apologize to you formally due to my ignorance with the EE Grading process.

Your efforts on last as well as this project are greatly appreciated.

Tiger
0
 
LunchyCommented:
Richie, get your points here.  It was a misunderstanding on TigerIBD's part.  I ended up reducing points on the question and dividing the points as mentioned above.


http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=visualbasic&qid=20163046
0
 
Dave_GreeneCommented:
Still working on it...

What's up Lunchy... Tiger...  Richie...

Cool, Cool
0
 
TigerIBDAuthor Commented:
Lunchy, I posted two different questions on EE-VB.

The first question(75-points) was resolved by Richie and wsh2 today. Richie will receive 50-points credit and wsh2 will receive 25-points credit.

The 2nd question(100-points) is still open. I still need help from Richie, wsh2 and Dave to solve this problem.

Thanks for your help!
Tiger
0
 
Richie_SimonettiIT OperationsCommented:
well, inet is not my strong knowledge. It was just a guess, i know that this could be done but i not know how.

i think something like
dim str as string

str = inet1.execute("http:\\www.investors.com\blahblahblah.asp?..........&id......, icstring)

dim ff as integer
ff=freefile
open "d:\ibd\msft.htm" for output as #ff
    print #ff,str
close #ff

and repeat for each one.
But blahblahblah.asp?..........&id...... is unknown!
Maybe doing a little "hack" to the link in the button Go!.
0
 
Richie_SimonettiIT OperationsCommented:
Sorry, i mean openurl method.
0
 
Richie_SimonettiIT OperationsCommented:
Just a guess:

Sub gotStock(symbol As String)
Dim str As String
str = Inet1.OpenURL("http://www.investors.com/member/checkup/checkUp.asp?t=" & UCase$(symbol) & "&sp=", icString)
MsgBox str

Dim ff As Integer
ff = FreeFile
Open "d:\" & symbol & ".htm" For Output As #ff
   Print #ff, str
Close #ff
End Sub
0
 
TigerIBDAuthor Commented:
Supplement to this Question(QID: #20163002):

In order to use this program as a practical application, I prefer any five stock symbols can be entered through the following five TextBoxes on the Form1.

TextBoxControl:        LabelControl:        LabelCaption:
txtSym1                  lblSym1                Symbol 1
txtSym2                  lblSym2                Symbol 2
txtSym3                  lblSym3                Symbol 3
txtSym4                  lblSym4                Symbol 4
txtSym5                  lblSym5                Symbol 5
----------
Richie, Thanks a lot for your great effort and genius ideas on this project.  

wsh2/Dave, Thank you very much for willing spent time to work on this project at present time.

Truly yours,
Tiger
0
 
Richie_SimonettiIT OperationsCommented:
So, the function would used like:

gotStock txtSym1

to navigate to each one, right?
By the way, is inet stuff working or not? I have doubt if server side proccess that request...
0
 
Richie_SimonettiIT OperationsCommented:
Try with this:
' ----NOTE: complete form code
VERSION 5.00
Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
Begin VB.Form frmSymbol
   Caption         =   "Form1"
   ClientHeight    =   2070
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4215
   LinkTopic       =   "Form1"
   ScaleHeight     =   2070
   ScaleWidth      =   4215
   StartUpPosition =   3  'Windows Default
   Begin InetCtlsObjects.Inet Inet1
      Left            =   2055
      Top             =   1305
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      Protocol        =   4
      URL             =   "http://"
   End
   Begin VB.CommandButton cmdGo
      Caption         =   "&Go!"
      Height          =   345
      Left            =   2925
      TabIndex        =   2
      Top             =   465
      Width           =   1215
   End
   Begin VB.ComboBox cboSymb
      Height          =   315
      Left            =   1800
      Sorted          =   -1  'True
      TabIndex        =   1
      Top             =   60
      Width           =   2325
   End
   Begin VB.Label Label1
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Please, selet a symbol:"
      Height          =   195
      Left            =   105
      TabIndex        =   0
      Top             =   90
      Width           =   1605
   End
End
Attribute VB_Name = "frmSymbol"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
' Don't forget to complete name and password
' of inet control properties.


Sub GetStock(symbol As String)
Dim str As String
str = Inet1.OpenURL("http://www.investors.com/member/checkup/checkUp.asp?t=" & UCase$(symbol) & "&sp=", icString)
MsgBox str

Dim ff As Integer
ff = FreeFile
Open "d:\" & symbol & ".htm" For Output As #ff
  Print #ff, str
Close #ff
End Sub

Private Sub cmdGo_Click()
    GetStock cboSymb.Text
End Sub


Private Sub Form_Load()
With cboSymb
    .AddItem "MSFT" '(Microsoft)
    .AddItem "INTC" '(Intel Company)
    .AddItem "DELL" '(Dell)
    .AddItem "IBM"  '(IBM)
    .AddItem "ORCL" '(Oracle)
    .ListIndex = 0
End With
End Sub
0
 
TigerIBDAuthor Commented:
Richie, Thank you very much for your generous heart and giving up your spare time to write the codes. I am only able to test these codes tomorrow. I will let you know the feedback.
0
 
Richie_SimonettiIT OperationsCommented:
That's OK. I can't test it by myself since i deleted the mail with uour password. ;)
0
 
TigerIBDAuthor Commented:
Richie,

What do you mean and how do you implement these attributes?
Attribute VB_Name = "frmSymbol"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

All,
If it is possible, I would like the max symbols in the Combo list are 25 symbols. Sorry for the last minutes change.

Thanks,
Tiger
0
 
TigerIBDAuthor Commented:
FYI,
Due to I am responsible for this last minutes change, I will accept both source codes based on Combo box has either maximum 5 symbols or maximum 25 symbols.



0
 
TigerIBDAuthor Commented:
All,

Please ignore my question on the number of the maxmium symbols on the ComboBox list.
 
0
 
Richie_SimonettiIT OperationsCommented:
But, if i understood, there is no "Max 5 symbols" at code,
I write the symbols that you have been asked only.
You could type in what you want!
0
 
LunchyCommented:
Richie_Simonetti, you miss my post????
---------
Richie, get your points here.  

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=visualbasic&qid=20163046 
0
 
TigerIBDAuthor Commented:
Richie,

Brilliant codes! Job well done!

Congratulations on your FULL 100 points credits!

Thank you very much for your Excellent work!

Tiger
0
 
TigerIBDAuthor Commented:
Brilliant Codes!!! Thank you very much!!!
0
 
TigerIBDAuthor Commented:
Richie,

I couldn't thank you enough to write these Excellent codes for downloading HTML files at last two projects.

Regarding the "Max 5 symbols" issue. I am thinking about to open another new Question on EE. This will be the Final Frontier for symbol downloading project. The basic idea is to ?Batch? the downloading process. The stock symbols will be pulling from a text file located at local computer drive at "d:\ibd\" folder. The maximum symbols can be entered inside this text file(for example, IBDSYMB.TXT) are 25 symbols. One additional Command button will be added at ?From1? to execute this Batch process.

?------- The contents of IBDSYMB.TXT are:
MSFT        ? ? symbol start here ?
ORCL
IBM
CSCO
RMBS
INTC
CHKP
SUNW
.
.
.
DELL       ' ? symbol end here ?
' With Maximum 25 symbols can be entered for this Batch downloading.

Regards,
Tiger
0
 
TigerIBDAuthor Commented:
Richie,

I couldn't thank you enough to write these Excellent codes for downloading HTML files at last two projects.

Regarding the "Max 5 symbols" issue. I am thinking about to open another new Question on EE. This will be the Final Frontier for symbol downloading project. The basic idea is to "Batch" the downloading process. The stock symbols will be pulling from a text file located at local computer drive at "d:\ibd\" folder. The maximum symbols can be entered inside this text file(for example, IBDSYMB.TXT) are 25 symbols. One additional Command button will be added at "Form1" to execute this Batch process.

'------- The contents of IBDSYMB.TXT are:
MSFT       ' ... symbol start here ...
ORCL
IBM
CSCO
RMBS
INTC
CHKP
SUNW
.
.
.
DELL       ' ... symbol end here ...
' With Maximum 25 symbols can be entered for this Batch downloading, or even better, if there is no limit.

Regards,
Tiger
0
 
TigerIBDAuthor Commented:
New question(QID: #20164280) was just posted on EE-VB?

Question (30-points): VB codes are needed for "Batch" downloading process?
--------------------------------
FYI, There is 10-points has been reserved for Dave Greene for his contribution on this project. This question is only the last part of downloading program.

Thank you very much for your help!

Tiger
0
 
Richie_SimonettiIT OperationsCommented:
But, at this time it is not dificult to implement a batch download....
You could populate the combo with all entries, iterate throghout each one and call Getsymb sub with that parameter...!!!!
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.