[已解决]贼菜的一个问题,FOR不循环……
本帖最后由 worldwong 于 2010-2-13 06:12 编辑就是想逐个打开列表页面里的歌曲操作(步骤省略)后关闭打开的歌曲页,再进行一首的操作。问题是打开第一个之后就O 了自动退出。我知道我写的代码比较垃圾,可我的确是不会玩了……
#include <IE.au3>
Local $Song, $time, $Temp
$oIE = _IECreate("http://fc.5sing.com/fcsong/more_1.shtml")
$Forme1 = GUICreate("", 0, 0, 0, 0)
$Song = GUICtrlCreateInput("", 0, 0, 0, 0)
For $i = 0 To 30
$Temp = _IEGetObjByName($oIE, "i_more", $i)
GUICtrlSetData($Song, $Temp.Value)
$oIE = _IECreate("http://fc.5sing.com/" & StringRegExpReplace(GUICtrlRead($Song), "[$,f,c]", "") & ".html")
Sleep(800)
WinActivate("翻唱 音乐")
Send("!{F4}")
WinActivate("所有翻唱")
Next
出错无提示? 提示:
D:\Program Files\autoit\Include\IE.au3 (2348) : ==> ??????(?????).:
If IsObj($o_object.document.GetElementsByName($s_Id).item($i_index)) Then
If IsObj($o_object.document^ ERROR
看不明白啊…… 自己解决了,多余的代码……$oIE多写一个
#include <IE.au3>
Local $Song, $time, $Temp
$oIE = _IECreate("http://fc.5sing.com/fcsong/more_1.shtml")
$Forme1 = GUICreate("", 0, 0, 0, 0)
$Song = GUICtrlCreateInput("", 0, 0, 0, 0)
$i = 0
While $i <= 10
WinActivate("所有翻唱")
$Temp = _IEGetObjByName($oIE, "i_more", $i)
GUICtrlSetData($Song, $Temp.Value)
_IECreate("http://fc.5sing.com/" & StringRegExpReplace(GUICtrlRead($Song), "[$,f,c]", "") & ".html")
Sleep(800)
WinActivate("翻唱 音乐")
Send("!{F4}")
$i = $i + 1
WEnd
页:
[1]