$file_html = FileRead(@ScriptDir & "\1.html")
Dim $html = ObjCreate("htmlfile")
With $html
.open()
.designmode = "on"
.write($file_html)
Dim $div = .getElementsByTagName("div")
EndWith
For $i = 0 To $div.length
If StringInStr($div($i).classname, "days7") Then
ExitLoop
EndIf
Next
$Aday = $div($i).getElementsByTagName("b")
$Atemp = $div($i).getElementsByTagName("span")
$Aweather = $div($i).getElementsByTagName("img")
$str = ""
Local $i = 0
Local $NAMES, $sComboTxt, $sComboTxt1;= "所有"
For $m = 0 To $Aday.length * 2 - 1 Step 2
$n = $m / 2
$str = $str & $Aday($n).innertext & " 温度:" & $Atemp($n).innertext & "白天:" & StringFormat("%-4s", $Aweather($m).Alt) & "晚上:" & $Aweather($m + 1).alt & @CRLF
;$i += 30
GUICtrlCreateLabel($Aday($n).innertext, 20, 260 + $i, 50, 240)
GUICtrlSetColor(-1,0x0220d3) ;字体颜色 ;0xab00fb;;0xFF00FF
GUICtrlSetFont(-1, 11, 600, 0, "微软雅黑")
我用这个也能获取么?应该怎样修改一下,当初我尝试用$Aweather = $div($i).getElementsByid("img"),获取id标签是不好用得,因为不知道这个.后面到底应该跟什么? |