欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

求php抓取网站天气代码,该如何处理

程序员文章站 2022-04-30 22:17:00
...
求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.html
http://m.weather.com.cn/data/101110101.html
等等
其中101110101是城市的代码,获得城市代码进入weather.com.cn

------解决方案--------------------
貌似几乎所有的这类工具都是这么抓的,voteon83 我一般也不告诉你..哈哈哈
探讨

引用:

基本上都有接口的,新浪的,腾讯的等等
http://www.weather.com.cn/data/sk/101110101.html
http://m.weather.com.cn/data/101110101.html
等等
其中101110101是城市的代码,获得城市代码进入weather.com.cn


+1,其实很多天气……

------解决方案--------------------
探讨
貌似几乎所有的这类工具都是这么抓的,voteon83 我一般也不告诉你..哈哈哈

引用:

引用:

基本上都有接口的,新浪的,腾讯的等等
http://www.weather.com.cn/data/sk/101110101.html
http://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;
求php抓取网站天气代码,该如何处理

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频