Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Yahoo stock onfo
Message
From
30/06/1999 14:30:26
 
 
To
30/06/1999 11:57:35
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00235812
Message ID:
00236060
Views:
19
>>>>>I can download historical stock data from Yahoo/Finance into a spreadsheet (their choice). The whole process is manual. Would it be possible to automate it?
>>>>>Thanks Mark
>>>>
>>>>At DevCon, Ken Levy showed how he can pull stock information from the web. He has a hidden page on his web site. Behind the scenes, the web application reads the HTML from MSNBC and converts the pertinent information into XML, then sends it to the browser. So, while the answer is yes, you can automate it...I don't know how. If you can find an XML source for the information, it would be MUCH easier.
>>>
>>>Is there any chance to see how it's done?
>>>Thanks Mark
>>
>>I don't think you can see how it is done. But you can switch over to the XML forum area of the UT and post your questions there. Ken Levy is the SysOp there.
>I thought he is monitoring this forum too <g>
>Thanks Mark

I should have been a little more specific about where I got what I posted in the previous message.

I went to the Yahoo page, clicked on Stock quotes, entered Dell in the box, hit enter, and looked at the href of the link to the Excel file in the resulting page. It's possible that this is all that needs to be done.

If the code that I sent you doesn't work, it's because Yahoo tracked my session at their page and that's what the second GET variable was in the URL used to download the file. Depending on what kind of cross-checking Yahoo on requests, that particular link may not work for you, because your IP address won't match mine.

This would just complicate automating your process, it doesn't make it impossible. If you find that you have to navigate from the front pge to get results, you'll just have to first navigate to the page using:

oIE.Navigate("http://finance.yahoo.com/?u")
oIE.Document.Forms(0).s.Value = "Dell"
oIE.Document.Forms(0).Submit

Then you should be able to get the link to the Excel file by checking the href property of the appropriate "a" member of the document.

I found the one you are looking for by looping through the Document's Links Collection like so:

FOR i = 1 TO oIE.Document.Links.Length
IF oIE.Document.Links(i).InnerText = "Download Spreadsheet Format"
oIE.Document.Links(i).Click()
ENDIF
ENDFOR

and that takes you to the file. IE doens't give a way to manage downloading of files, so you have to deal with the Save As Dialog on your own.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform