'自己加个计时器定时刷新 Option Explicit Private Sub Command1_Click() Dim ul As String, mark As String, s As String, temp As String ul = "http://www.lecai.com/lottery/draw/view/200?phase=20130312072&agentId=5555" Command1.Enabled = False With CreateObject("InternetExplorer.Application") .Visible = False .navigate ul Do Until .readyState = 4 DoEvents Loop s = .document.body.innerhtml End With mark = "latest_draw_time = " If InStr(s, mark) = 0 Then Command1.Enabled = True Exit Sub End If temp = Mid(s, InStr(s, mark) + Len(mark) + 1, 20) & vbNewLine mark = "var phaseData = {""" & Format(Date, "yyyy-mm-dd") & """:" s = Mid(s, InStr(s, mark) + Len(mark), Len(s)) mark = """red""" s = Mid(s, InStr(s, mark) + Len(mark) + 2, 19) temp = temp & s MsgBox temp Command1.Enabled = True End Sub更多追问追答追问
'自己加个计时器定时刷新
Option Explicit
Private Sub Command1_Click()
Dim ul As String, mark As String, s As String, temp As String
ul = "http://www.lecai.com/lottery/draw/view/200?phase=20130312072&agentId=5555"
Command1.Enabled = False
With CreateObject("InternetExplorer.Application")
.Visible = False
.navigate ul
Do Until .readyState = 4
DoEvents
Loop
s = .document.body.innerhtml
End With
mark = "latest_draw_time = "
If InStr(s, mark) = 0 Then
Command1.Enabled = True
Exit Sub
End If
temp = Mid(s, InStr(s, mark) + Len(mark) + 1, 20) & vbNewLine
mark = "var phaseData = {""" & Format(Date, "yyyy-mm-dd") & """:"
s = Mid(s, InStr(s, mark) + Len(mark), Len(s))
mark = """red"""
s = Mid(s, InStr(s, mark) + Len(mark) + 2, 19)
temp = temp & s
MsgBox temp
Command1.Enabled = True
End Sub更多追问追答追问
多实验几次出现错误提示