本帖最后由 lixiaolong 于 2011-1-26 02:30 编辑
回复 1# Netfox
$data = FileRead(@ScriptDir & "\Sourcedata.tmp")
$title = StringRegExp($data, '<td .+arget="i_product">(.*?)</a></td>', 3)
$url = StringRegExp($data, '<a href="(.+?)"\s[class="i_product"][^>]*>', 3)
For $i = 0 To UBound($title) - 1
IniWrite("BigClass.db", "BigClass", $title[$i], $url[$i])
Next
;FileDelete(@ScriptDir & "\Sourcedata.tmp")
下面的2个代码加了MsgBox,你实行一下看看什么样的动作
你的代码$data = FileRead(@ScriptDir & "\Sourcedata.tmp")
$title = StringRegExp($data, '<td .+arget="i_product">(.*?)</a></td>', 3)
$url = StringRegExp($data, '<a href="(.+?)"\s[class="i_product"][^>]*>', 3)
For $i = 0 To UBound($title) - 1
MsgBox(0,0,$title[$i])
For $k = 0 To UBound($url) - 1
MsgBox(0,0,$url[$k])
IniWrite("BigClass.db", "BigClass", $title[$i], $url[$k])
Next
Next
修改后的代码$data = FileRead(@ScriptDir & "\Sourcedata.tmp")
$title = StringRegExp($data, '<td .+arget="i_product">(.*?)</a></td>', 3)
$url = StringRegExp($data, '<a href="(.+?)"\s[class="i_product"][^>]*>', 3)
For $i = 0 To UBound($title) - 1
MsgBox(0,0,$title[$i])
MsgBox(0,0,$url[$i])
IniWrite("BigClass.db", "BigClass", $title[$i], $url[$i])
Next
|