请看我的笨方法把我害成什么样了
我搞网页数据截取,用了最笨的循环字符查找,到了最后,字符越来越大,速度慢的惊人。
Private Sub Command1_Click()Dim uk1 As Stringuk1 = "ENG PR"'----------------------------------------------------------------Dim code As StringDim pickscode As StringDim keyword As Stringpickscode = "http://data.nowgoal.com/1x2/company.aspx?id=281&company=Bet 365"code = getHtmlStr$(pickscode)Dim start, startkey, over, overkeystartkey = "Compare"start = InStr(1, code, startkey, 1)overkey = "Back to Top"over = InStr(2000, code, overkey, 1)Dim xDim a, b, c, d, e, f, g, h, y, j, k For x = start To over a = Left(code, x) a = Right(a, 1) b = Left(code, x + 1) b = Right(b, 1) c = Left(code, x + 2) c = Right(c, 1) d = Left(code, x + 3) d = Right(d, 1) e = Left(code, x + 4) e = Right(e, 1) f = Left(code, x + 5) f = Right(f, 1) g = Left(code, x + 6) g = Right(g, 1) h = Left(code, x + 7) h = Right(h, 1) y = Left(code, x + 8) y = Right(y, 1) j = Left(code, x + 9) j = Right(j, 1) k = Left(code, x + 10) k = Right(k, 1) '找到联赛名 Dim league As String If a + b + c = "e31" Then Dim overl, lstr For overl = x + 2 To x + 20 lstr = Left(code, overl) lstr = Right(lstr, 1) If lstr = "<" Then league = Left(code, overl - 1) league = Right(league, overl - 1 - (x + 4)) Text1(1) = league Exit For End If Next overl End If DoEvents Text2 = Format(x / over, "##.#######") Next x