+ -
当前位置:首页 → 问答吧 → 请看我的笨方法把我害成什么样了

请看我的笨方法把我害成什么样了

时间:2011-11-30

来源:互联网

我搞网页数据截取,用了最笨的循环字符查找,到了最后,字符越来越大,速度慢的惊人。

Private Sub Command1_Click()
Dim uk1 As String
uk1 = "ENG PR"
'----------------------------------------------------------------------------------------------------------------------------------------
Dim code As String
Dim pickscode As String
Dim keyword As String
pickscode = "http://data.nowgoal.com/1x2/company.aspx?id=281&company=Bet 365"
code = getHtmlStr$(pickscode)


Dim start, startkey, over, overkey
startkey = "Compare"
start = InStr(1, code, startkey, 1)
overkey = "Back to Top"
over = InStr(2000, code, overkey, 1)
Dim x
Dim 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


我的思路是把code 分解开来,弄成几个code,但是中间分隔不均就会造成数据丢失,请问有没有什么好办法呢,因为这个支付超过20万个。。。。。
汗。。。

作者: justin919   发布时间: 2011-11-30

汗是嗒嗒嘀

作者: patrickkong   发布时间: 2011-11-30

没看懂的路过……

作者: yiguangqiang88   发布时间: 2011-11-30

热门下载

更多