|
请高手门指教,为何编译后显示为设置变量
$g_szVersion = "天气预报"
If WinExists($g_szVersion) Then Exit ; 此脚本已经运行了
AutoItWinSetTitle($g_szVersion)
Opt("GUICloseOnESC", 0)
Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 0)
Opt("TrayIconHide", 0)
#include <IE.au3>
Local Const $weatherFile = "天气预报.ini"
Local Const $city = IniRead($weatherFile, "天气预报", "城市编号", "166")
IniWrite($weatherFile, "天气预报", "城市编号", $city)
$Url = "http://weather.qq.com/inc/07_ss" & $city & "/.htm"
$oIE = _IECreate($Url, 0, 0)
$sHTML = _IEBodyReadHTML($oIE)
$array = StringRegExp($sHTML, "<(?i)td height=77 class=wht2 lk37><div class=txbd>(.*?)</(?i)div>", 1)
For $i = 0 To UBound($array) - 1
$tqtemp = $array[$i]
Next
$weather = StringReplace($tqtemp, " ", " ")
$array2 = StringRegExp($sHTML, "</(?i)div>(.*?)</(?i)td>", 1)
For $i = 0 To UBound($array2) - 1
$tqtemp2 = $array2[$i]
Next
$weatheren = StringReplace($tqtemp2, " ", " ")
$array3 = StringRegExp($sHTML, "<(?i)td class=whp3 lk37>(.*?)<(?i)br>", 1)
For $i = 0 To UBound($array3) - 1
$tqtemp3 = $array3[$i]
Next
$wind = StringReplace($tqtemp3, " ", " ")
IniWrite($weatherFile, "天气预报", "天气", $weather)
IniWrite($weatherFile, "天气预报", "温度", $weatheren)
IniWrite($weatherFile, "天气预报", "风力", $wind)
_IEQuit($oIE)
Exit |
|