Solved

How to collect stream tick stock data in IE by VBA

Posted on 2010-09-14
5
886 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
null output 3 25
Java Script Error encountered while loading a page, IBM Lotus Notes 6 22
jsp login check 12 32
Copy a range from 1..n excel sheets to one destination sheet 2 33
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

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