|
发表于 2019-8-13 16:36:55
|
显示全部楼层
本帖最后由 sadate 于 2019-8-13 18:13 编辑
那就试试这个,看看返回数据量是否超标 (标红部分改为你要的地名的拼音)
http://i.tianqi.com/index.php?c=code&a=getcode&id=83&py=mentougou
返回数据:(标红部分是你要的数据)
<html ><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>门头沟天气预报代码调用</title>
</head>
<style type="text/css">
body{margin:0;padding:0;font-size:12px;font-fanliy:"宋体",arial;}
body, h1, h2, h3, h4, h5, h6, hr, p, dl, dt, dd, ul, ol, li, pre, fieldset, lengend, textarea, th, td{ margin: 0;padding: 0;}
em{font-size: 12px;font-weight: normal;font-style: normal;}
ul{list-style-type:none;margin:0;padding:0;}
li{list-style-type:none;margin:0;padding:0;}
img{border:0;text-align:top;}
a:link,a:visited,a:hover,a:active{color:#333;text-decoration:none;}
a:hover{color:#333;text-decoration:none;}
.fon16 {font-size:16px;}
.fon14 {font-size:14px;}
.fB {font-weight:bold;}
.today_data{ height:176px}
.today_data_w{ width:160px; height:174px; border:1px solid #9adaff; float:left; background:url("//static.tianqistatic.com/static/images/tq_bg.jpg") repeat-x bottom #fff; margin-right:7px}
.today_data_m{ width:330px; height:174px; border:1px solid #9adaff; float:left; background:url("//static.tianqistatic.com/static/images/tq_bg.jpg") repeat-x bottom #Fff;margin-right:7px;}
.tqshow {width:140px;margin:0 auto;text-align:center}
.tqshow h3,.temp h3,.wind h3{ font-family: "微软雅黑", "宋体"; font-size:16px; color:#0d4b94; padding:10px 0 0;}
.tqshow li {line-height:21px;overflow:hidden;}
.tqshow li img {width:54px;height:54px;margin-bottom:1px;}
.cRed, a.cRed:link, a.cRed:visited {color:#c00;}
.cDRed, a.cDRed:link, a.cDRed:visited {color:#c00;font-size:14px;font-weight:bold;}
.cDRed1, a.cDRed1:link, a.cDRed1:visited {font-size:18px;font-weight:bold;color:#CC0000}
.cGreen, a.cGreen:link, a.cGreen:visited {color:#499704;}
.cBlue, a.cBlue:link, a.cBlue:visited {color:#005EAC;}
.cOrange, a.cOrange:link, a.cOrange:visited {color:#ff8800;}
.cWhite, a.cWhite:link, a.cWhite:visited, a.cWhite:hover {color:#fff;text-decoration:none;}
.cYellow, a.cYellow:link, a.cYellow:visited, a.cYellow:hover {color:#FCCC00;text-decoration:none;}
.temp { width:162px;height:174px;float:left;text-align:center; overflow:hidden;}
.tqshow h3,.temp h3,.wind h3{ font-family: "微软雅黑", "宋体"; font-size:16px; color:#0d4b94; padding:10px 0 0;}
.tqshow li {line-height:21px;overflow:hidden;}
.tqshow li img {width:54px; height:54px;margin-bottom:1px;}
.weatherDiv1{float:left;width:151px;height:138px;background: url("//static.tianqistatic.com/static/images/wenduji1.gif") no-repeat 45px 4px;margin:0 0 0 7px;display:inline;position:relative; z-index:0;}
.weatherDiv1 .numN{position:absolute;width:32px;font-size:9px;color:#000;line-height:12px;text-align:right;top:22px;left:18px;font-family:Tahoma; }
.weatherDiv1 p.bg_sk{background:#99b0d6 no-repeat;width:8px;position:absolute;top: 7px;left:54px;}
.weatherDiv1 .tq24_1{width:120px;text-align:center;display:block;clear:both; line-height:20px;color:#203665;position: absolute;left: 0px;bottom: 2px;}
.weatherDiv1 .tq24_1 a{ color:#f00;display:block;position:absolute;right:0;margin-top:0px;width:120px;text-align:center;bottom: 0px;}
.weatherDiv1 .tq24_1 a:hover{color:#f00;text-decoration:underline;}
.weatherDiv1 strong{ font-family:Tahoma, serif;font-weight:bold;font-size:22px; display:block;float:right;margin-right:10PX;width:85px;text-align:center;left:55px; position:absolute;top:30px; color:#0a50a5;}
.weatherDiv1 a{display:block;position:absolute;right:0; margin-top:30px;width:110px;text-align:center;color:#000;}
.weatherDiv1 a:hover{text-decoration:none;color:#000;}
.weatherDiv1 span{width:120px;text-align:center;display:block;clear:both; line-height:20px;color:#203665;position: absolute;left: 0px;bottom: 24px;}
.wind {width:165px; height:174px;float:left;text-align:center; position:relative; overflow:hidden;}
.weatherDiv2 span{display:block;padding-top:0px;color:#203665; line-height:20px;}
.weatherDiv2 strong {display:block; margin-bottom:40px;_margin-bottom:40px; font-size:12px;margin-top: 40px;font-size: 12px; font-weight: normal;}
.weatherDiv2 a{color:#000;}
.weatherDiv2 a:hover{text-decoration:none;color:#000;}
.weatherDiv2{float:left;width:151px;height:110px;background:url("//static.tianqistatic.com/static/images/n.gif") no-repeat center 0px;display:inline;text-align:center;margin-top:0px;}
.pm25box{float:left;height:26px; line-height:20px; width:190px; text-align:center; color:#333;overflow:hidden;position:absolute; left:-22px;_left:-22px; bottom:0px;}
.pm25box .t1{ color:#08c; margin-right:4px;font-size:12px;}
.pm25box .p1{ background:#090; color:#fff; padding:2px 3px;}
.pm25box .p2{ background:#69DC4E; color:#fff; padding:2px 3px;}
.pm25box .p3{ background:#F9AF4F; color:#fff; padding:2px 3px;}
.pm25box .p4{ background:#DA1B16; color:#fff; padding:2px 3px;}
.pm25box .p5{ background:#B20F50; color:#fff; padding:2px 3px;}
.pm25box .p6{ background:#4E0320; color:#fff; padding:2px 3px;}
</style>
<body>
<div class="today_data">
<div class="today_data_w">
<div class="tqshow" id="today">
<h3 style="padding-bottom:0px;">门头沟今天天气</h3>
<ul>
<li class="time">08月13日</li>
<li class="tqpng_01"><img class='pngtqico' align='absmiddle' src='http://plugin.tianqistatic.com/static/images/tianqibig/b1.png' style='border:0;width:46px;height:46px'/></li>
<li class="fon14 fB">
<span id="t_temp"><font color="#f00">33℃</font>~<font color="#4899be">23℃</font></span>
</li>
<li class="cDRed">多云</li>
<li style="height:18px;overflow:hidden">东北风 4级 </li>
</ul>
</div>
</div>
<div class="today_data_m">
<div class="temp">
<h3>门头沟当前温度</h3>
<div class="weatherDiv1">
<div class="numN"> 50-<br>
25-<br>
0-<br>
-25-<br>
-50- </div>
<p class="bg_sk" style="height:27px" id="rethigh"></p>
<div id="rettemp"><strong>32°</strong><span>相对湿度:46%</span></div>
<div class="tq24_1"><a href="http://beijing.tianqi.com/mentougou/?tq" target="_blank">24小时天气预报</a></div>
</div>
</div>
<div class="wind">
<h3>风向风力</h3>
<div class="weatherDiv2" id="retwind" style="background: url('//www.tianqi.com/static/images/ne.gif') no-repeat scroll center 0;">
<strong>4级</strong><span>东北风</span>
</div>
</div>
</div>
</div>
<div style="display: none;">
<script type="text/javascript">
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?86f43783acc56b0c8abb5bb039edc763";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script type="text/javascript" src="https://s5.cnzz.com/z_stat.php?id=1277635480&web_id=1277635480"></script>
</div>
</body>
</html>
<script type="text/javascript">num=0;temp=0;</script>
|
打赏
-
查看全部打赏
|