Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Question for Richie Simonetti, wsh2 and Dave Greene?

Posted on 2001-08-03
33
Medium Priority
?
301 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:TigerIBD
[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
  • 16
  • 11
  • 4
  • +1
33 Comments
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6349813
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
 

Author Comment

by:TigerIBD
ID: 6349878
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6349926
You don't get anything else from me, sorry.
0
Technology Partners: 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!

 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6349949
Richie,

He'll do right by ya...  I'll give you points if he won't..  Just stay in the game!
0
 

Author Comment

by:TigerIBD
ID: 6349997
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
 

Author Comment

by:TigerIBD
ID: 6350069
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
 

Author Comment

by:TigerIBD
ID: 6350112
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6350567
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
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6350583
That's a good place to start..
0
 

Author Comment

by:TigerIBD
ID: 6350592
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
 
LVL 2

Expert Comment

by:Lunchy
ID: 6350664
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
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6350670
Still working on it...

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

Cool, Cool
0
 

Author Comment

by:TigerIBD
ID: 6350736
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6350747
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6350760
Sorry, i mean openurl method.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6350768
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
 

Author Comment

by:TigerIBD
ID: 6353336
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6353465
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6353880
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
 

Author Comment

by:TigerIBD
ID: 6354322
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6354598
That's OK. I can't test it by myself since i deleted the mail with uour password. ;)
0
 

Author Comment

by:TigerIBD
ID: 6356855
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
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 400 total points
ID: 6357038
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
 

Author Comment

by:TigerIBD
ID: 6357086
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
 

Author Comment

by:TigerIBD
ID: 6357176
All,

Please ignore my question on the number of the maxmium symbols on the ComboBox list.
 
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6357326
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
 
LVL 2

Expert Comment

by:Lunchy
ID: 6357428
Richie_Simonetti, you miss my post????
---------
Richie, get your points here.  

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

Author Comment

by:TigerIBD
ID: 6357477
Richie,

Brilliant codes! Job well done!

Congratulations on your FULL 100 points credits!

Thank you very much for your Excellent work!

Tiger
0
 

Author Comment

by:TigerIBD
ID: 6357490
Brilliant Codes!!! Thank you very much!!!
0
 

Author Comment

by:TigerIBD
ID: 6357626
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
 

Author Comment

by:TigerIBD
ID: 6357643
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
 

Author Comment

by:TigerIBD
ID: 6357948
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6359419
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Suggested Courses

610 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