• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

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

php 搞代码 3年前 (2022-01-23) 16次浏览 已收录 0个评论

求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,其实很多天气……

——解决方案——————–

探讨

貌似几乎所有的这类工具都是这么抓的,voteo

本&文来源gaodai^.ma#com搞#代!码网

搞gaodaima代码n83 我一般也不告诉你..哈哈哈

引用:

引用:

基本上都有接口的,新浪的,腾讯的等等
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;


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:求php抓取网站天气代码,该如何处理

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址