Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Name: reno
i am trying to get stock quote from yahoo fnance, using internetexplorer object. i try to cut the unneeded html code, and get the table only.
i've the following code, it modified the html to only show table, but the problem is the streaming quote/ticker is not updating.url = "http://finance.yahoo.com/intlindices?e=asia" 'url = "http://finance.yahoo.com/indices?e=dow_jones" set ie=wscript.createobject("internetexplorer.application") ie.addressbar=0:ie.menubar=0:ie.toolbar=0 if wsh.arguments.count=0 then ie.statusbar=1 else ie.statusbar=0 ie.top=-20 ie.left=0 ie.width=430 ie.height=380 ie.Visible = true ie.navigate2 url while ie.readystate<>4 : wsh.sleep 100 : wend html=ie.document.body.innerhtml write=false for each s in split(html,vbcrlf) 'get the javascript coding part located at top if instr(s,"<DIV id=ygma>")<>0 then write=false 'line 12 'get html code for index ticker table if instr(s,"<DIV id=yficc>")<>0 then write=true 'line 114 if instr(s,"<DIV id=th>")<>0 then write=false 'line 187 'get the javascript coding part located at bottom if instr(s,"Copyright/IP Policy")<>0 then write=true:s="<TABLE><TBODY><TR>"&s 'line 229 end if if instr(s,"Quotes delayed")<>0 then s="" 'remove line 258 if write=true then newhtml=newhtml&s&vbcrlf next if wsh.arguments.count=0 then ie.document.body.innerhtml=newhtml set ie=nothingcscript//nologo test.vbs -- this one not work
cscript//nologo test.vbs dontcut - this one worksany idea what's wrong? i think it's something to do with the html coding, but my knowledge in html is minimal. can i anyone take a look into this.
my purpose is to get the html that display the ticker table only with streaming code 'on'.
i also have tried to save the page as html then edit the htm file manually.

hmm interesting reno, sorry i cant help with it as you are with my Questions. but non less interesting what you want to do.
i like it.

ie.document.body.innerhtml=newhtml
This line will either destroy the page's javascript, or it's causing the script(s) to bomb. That's why it doesn't auto-update.

i guess so, the javascript got messed up.
even without stripping the html code, just reassigning the str to innerhtml mess up the auto-update
eg.html=ie.document.body.innerhtml ie.document.body.innerhtml=htmlis there any way to workaround this?
i can't keep reloading the page and parse the value, as my connection pipe is small.i also tried to relieve the bandwith to another server using asp, works on first try, it load the page, but later cause server internal error. and i dont have the chance to parse the page content to only get the numbers i need.
<%@Language=vbScript%> <% dim url ' url="http://finance.yahoo.com/intlindices?e=asia" url="http://finance.yahoo.com/indices?e=dow_jones" dim xmlhttp set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP") xmlhttp.Open "GET",url,false xmlhttp.send response.write readystate & "<br>" response.write xmlhttp.responsexml response.write xmlhttp.responsestream set xmlhttp = nothing %>my purpose is to display the running-index in a small no-scroll window using minimal bandwith. any idea?

Something like wget might be able to pull only the HTML text document, in which case it becomes a simple text parsing problem

![]() |
Effective tool for run-ti...
|
nt batch to replace strin...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |