求php抓取网站天气代码求php抓取网站天气代码------解决方案--------------------基本上都有接口的,新浪的,腾讯的等等http://www.weather.com.cn/data/sk/101110101.html http://m.weather.com.cn/data/101110101.html等等其中101110101是城市的代码,获得城市代码进入weather.com.cn------解决方案--------------------探讨基本上都有接口的,新浪的,腾讯的等等http://www.weather.com.cn/data/sk/101110101.htmlhttp://m.weather.com.cn/data/101110101.html等等其中101110101是城市的代码,获得城市代码进入weather.com.cn------解决方案--------------------貌似几乎所有的这类工具都是这么抓的,voteon83 我一般也不告诉你..哈哈哈探讨引用:基本上都有接口的,新浪的,腾讯的等等http://www.weather.com.cn/data/sk/101110101.htmlhttp://m.weather.com.cn/data/101110101.html等等其中101110101是城市的代码,获得城市代码进入weather.com.cn+1,其实很多天气……
------解决方案--------------------探讨貌似几乎所有的这类工具都是这么抓的,voteon83 我一般也不告诉你..哈哈哈引用:引用:基本上都有接口的,新浪的,腾讯的等等http://www.weather.com.cn/data/sk/101110101.htmlhttp://m.weather.com.cn/data/10111010……
------解决方案--------------------有现成的接口供网页嵌入,何苦抓过来抓过去------解决方案--------------------探讨有现成的接口供网页嵌入,何苦抓过来抓过去------解决方案--------------------http://6shandong.com/123/weatherplugin.html------解决方案--------------------$source = file_get_contents("http://www.weather.com.cn/data/cityinfo/".$carr[1].".html");$obj=json_decode($source);echo $obj->weatherinfo->city.' '.$obj->weatherinfo->weather.' '.$obj->weatherinfo->temp1.'~'.$obj->weatherinfo->temp2;
