请看我的笨方法把我害成什么样了
时间: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万个。。。。。
汗。。。
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
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28