Home > Software engineering >  For dynamic data read from the web site code
For dynamic data read from the web site code

Time:10-25

It is best to use VB, other software can also,
How to from the mainstream website such as sina finance and economics plate stock market places such as read data, display in VB label, 20 seconds to read a new,
Is pretty simple, but it is difficult to carry out oh,,,
Strives for the code,,,

CodePudding user response:

Their top, first, to trouble you,, I am novice, what make point if it was ok, a little more complicated point not

CodePudding user response:

1, control Text1: MultiLine is set to True

2, control Timer1: the Interval is set to 20000

 

Private Sub Timer1_Timer ()
On the Error Resume Next
The Set x=CreateObject (" msscriptcontrol. Scriptcontrol)
X.L anguage="JavaScript"
Text1. Clear
With CreateObject (" WinHttp WinHttpRequest. 5.1 ")
. Open the "GET", "http://hq.sinajs.cn/rn=" & amp; X.E val (" (new Date). GetTime ();" ) & amp; "& amp; List=s_sh000001 s_sz399001 ", False
. SetRequestHeader "Referer", "http://finance.sina.com.cn/stock/"
. Send
X.A ddCode. The responsetext
Text1. Text=x.E val (" hq_str_s_sh000001 ") & amp; VbCrLf & amp; X.E val (" hq_str_s_sz399001 ")
End With
End Sub

  • Related