Connecting to an Internet resource

L

Leslie Coover

http://finance.yahoo.com/



offers a wide range of financial data.



Would anyone have (or know where I can get) a sample of code that

accesses a specific element of data (e.g., payout ratio, current
liabilities, current market price, etc.)from

http://finance.yahoo.com/

or similar site and collects it in an MS Access Query so latest data is
present whenever the MS Access db is opened?



Perhaps you could point me in the direction of a few resources (Web
articles, books, etc.) if this type of coding is possible.



The following is a part of the HTML code on http://finance.yahoo.com/ that
identifies "Last Trade" of "54.00"



Last Trade:</td><td class="yfnc_tabledata1"><big><b><span
id="yfs_l10_vlo">54.00</span></b></big></td></tr><tr><td
class="yfnc_tablehead1" width="48%">



Thanks!
 
W

Warren

The below gets the weather forcasts on a daily basis for me...

There is more to my app than this but this is the bit that connects to
the internet and downloads the pages' body's text to the file
"H:\Temp\BOM.txt".


Function GetForcast()
Dim fs, a
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("h:\Temp\BOM.txt", True)
a.WriteLine
(sGetURLText("http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV10580.txt"))
a.Close
End Function

Function sGetURLText(sURL As String) As String
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
'ie.Visible = True
ie.Navigate sURL
Do Until ie.ReadyState = 4
DoEvents
Loop
sGetURLText = ie.Document.body.innerText
If InStr(1, sGetURLText, "The page cannot be displayed", _
vbTextCompare) Then sGetURLText = ""
ie.Quit
Set ie = Nothing
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top