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
Solved

How to collect stream tick stock data in IE by VBA

Posted on 2010-09-14
5
888 Views
Last Modified: 2012-05-10
Dear Expert,

I get one stock software Java Applet application running in IE 7, and I know a little of
internet data extraction and Java Applet programming. Now I try to use VBA to
start my project to collect the live data in every minutes into excel file format.
In the market, there is a lot of company provide this kind of service such as the following website
http://www.analyzerxl.com/qtxl.htm, but its target data extraction website is assigned in certain or destinated website address only. It is not helping me at all. SO I try to write the VBA program instead.
First of above, I will  use nagviate to locate my website and activate the software application in
the IE instance or window and I found the difficuity to collect the data becase it is Java Script
for Java Applet  and it is not easier than collecting table or data from HTML document using
ie.document.getelementbytage or Webquery Excel table. Anyone is familar with the data
collection in IE  by VBA, please advise and help on it

Please advise

DUncan





Sub loginonly()
Dim myIE As SHDocVw.InternetExplorer
Set myIE = Nothing
Set myIE = CreateObject("InternetExplorer.Application")
With myIE
 .Visible = True
.navigate "https://www.dowstock.com.hk/nfs/login.htm?lang=zh_US"
Call WAITING(myIE, 10)
.document.all("j_username").Value = "username"
.document.all("j_password").Value = "passwrod"
.document.all("login").Click
Call WAITING(myIE, 10)

.document.Links(50).Click  ' To activate the stock live Java Applet application in the same IE
Window 
Call WAITING(myIE, 11)
.ie.document,getelementby ''Try to write a code for data collection

Function WAITING(ByRef myIE As SHDocVw.InternetExplorer, state1 As Integer)
With myIE
        
    Do Until Not .Busy And .readyState = READYSTATE_COMPLETE
       
        ' Debug.Print state1' Debug.Print .Busy ' Debug.Print .readyState
        'Sleep (300)
    Loop
    
    
 End With
End Function

Open in new window

0
Comment
Question by:duncanb7
  • 3
5 Comments
 
LVL 13

Expert Comment

by:Surone1
ID: 33674536
without seeing the source for that page i cannot be certain. but if the ticker data is shown by a java applet it's probably impossible to have ie retrieve it.
0
 
LVL 13

Author Comment

by:duncanb7
ID: 33674754
It is Java Applet application data , but why impossible , it should be okay if I can read the data in
my computer. Whether the protocol data format transmit in web by Java Applet is defined by
software company? It should be  same data format for client collect like IE could read
the data and shown it in IE windows no matter it is Java Applet or not

Please read the the source code of the web page and advise

Thanks

Duncan
stockfuture-1-.txt
0
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 33685016
Duncan

I don't know if it's strictly impossible but I'm pretty sure you can't do it in a similar way you would get data from a webpage.

You say that you can read the data somehow, how exactly?

I don't actually know why you are surprised that this isn't straightforward and how the source code of the web page can help.

I've looked at the code and it doesn't really give much away, as far as I can see the only relevant code is for displaying the applet.

All the other code appears to be for other elements on the page.

Have you considered some other method to get the data you want?
0
 
LVL 13

Author Comment

by:duncanb7
ID: 33721095
Yes, you are right, after talking to other experts, it is impossible to extract the Applet data except
we have the actual source code of Java Applet program from the data provider that will help to know
the data format to send to the client 's computer.

0
 
LVL 13

Author Closing Comment

by:duncanb7
ID: 33721263
Thanks for allof you to reply
the question
Duncan
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

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

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to implement Singleton Design Pattern in Java.

809 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