如下,获取不到天气信息,请指点一下。<script type="text/javascript">
$(function () {
$.getJSON("http://m.weather.com.cn/data/101010100.html", function (js) {
var str = js.weatherinfo.city;
alert(str);
});
})
</script>
$(function () {
$.getJSON("http://m.weather.com.cn/data/101010100.html", function (js) {
var str = js.weatherinfo.city;
alert(str);
});
})
</script>
Sub 天气预报()
With CreateObject("Msxml2.XMLHTTP")
dt = Split("city,city_en,date_y,date,week,fchh,cityid,temp1,temp2,temp3,temp4,temp5,temp6,tempF1,tempF2,tempF3,tempF4,tempF5,tempF6,weather1,weather2,weather3,weather4,weather5,weather6,img1,img2,img3,img4,img5,img6,img7,img8,img9,img10,img11,img12,img_single,img_title1,img_title2,img_title3,img_title4,img_title5,img_title6,img_title7,img_title8,img_title9,img_title10,img_title11,img_title12,img_title_single,wind1,wind2,wind3,wind4,wind5,wind6,fx1,fx2,fl1,fl2,fl3,fl4,fl5,fl6,index,index_d,index48,index48_d,index_uv,index48_uv,index_xc,index_tr,index_co,st1,st2,st3,st4,st5,st6,index_cl,index_ls,index_ag", ",") .Open "GET", "http://m.weather.com.cn/data/101010100.html", False
.Send
str1 = .responsetext
End With a = "天气预报.weatherinfo."
With CreateObject("MSScriptControl.ScriptControl")
.Language = "JScript"
.AddCode "var 天气预报 = " & str1
For i = 0 To UBound(dt) - 1
Debug.Print .Eval(a & dt(i))
Next i
End With
End Sub