1.怎样在Blog里面放上每天的天气预报呢?

2.急求可用的天气预报代码--

3.ASP.NET实现天气预报

4.求天气预报代码

5.大家看看这段天气预报代码,为什么我把它粘贴到我的网站中,却显示3月份的天气预报?怎样才能显示当前的?

6.用python编写的获取天气预报的代码总是有错误,求解

html天气预报连接_实时天气预报html代码

Internet Explorer 5.5 支持浮动框架的内容透明。如果想要为浮动框架定义透明内容,则必须满足下列条件。 与 IFRAME 元素一起使用的 ALLOWTRANSPARENCY 标签属性必须设置为 true。 在 IFRAME 内容源文档,background-color 或 BODY 元素的 BGCOLOR 标签属性必须设置为 transparent。 参看使用透明的浮动框架可以获得关于透明浮动框架更多的信息。 此元素在 Microsoft? Internet Explorer 4.0 的 HTML 和脚本中可用。 此元素是一个块元素。 此元素需要关闭标签。 示例 下面的例子使用了 IFRAME 元素创建了包含页面 sample.htm 的框架。 iframe 标签 -- 代表HTML内联框架 * iframe标签是成对出现的,以<iframe>开始,</iframe>结束 * 属性 o name -- 定义了内容页名称,此名称在框架页内链接时使用到 o frameborder -- 定义了内容页的边框,取值为(1|0),缺省值为1 o marginwidth -- 定义了框架中HTML文件显示的左右边界的宽度,取值为px,缺省值由浏览器决定 o marginheight -- 定义了框架中HTML文件显示的上下边界的宽度,取值为px,缺省值由浏览器决定 o align -- 垂直或水平对齐方式 o height -- 框架的高度 o width -- 框架的宽度 下面的例子返回了对 IFRAME 包含的文档的 all 集合的引用。 var collAll = document.frames("IFrame1").document.all 标签属性 属性 描述 ALIGN align 设置或获取表格排列。 ALLOWTRANSPARENCY allowTransparency 设置或获取对象是否可为透明。 APPLICATION APPLICATION 表明对象的内容是否为 HTML 应用程序(HTA),以便免除浏览器安全模式。 ATOMICSELECTION 指定元素及其内容是否可以一不可见单位统一选择。 BEGIN begin 设置或获取时间线在该元素上播放前的延迟时间。 BORDER border 设置或获取框架间的空间,包括 3D 边框。 canHeChildren 获取表明对象是否可以包含子对象的值。 canHeHTML 获取表明对象是否可以包含丰富的 HTML 标签的值。 CLASS className 设置或获取对象的类。 contentWindow 获取指定的 frame 或 iframe 的 window 对象。 DATAFLD dataFld 设置或获取由 dataSrc 属性指定的绑定到指定对象的给定数据源的字段。 DATASRC dataSrc 设置或获取用于数据绑定的数据源。 disabled 获取表明用户是否可与该对象交互的值。 END end 设置或获取表明元素结束时间的值,或者元素设置为重复的简单持续终止时间。 firstChild 获取对象的 childNodes 集合的第一个子对象的引用。 FRAMEBORDER frameBorder 设置或获取是否显示框架的边框。 hasMedia 获取一个表明元素是否为 HTML+TIME 媒体元素的 Boolean 值。 HEIGHT height 设置或获取对象的高度。 HIDEFOCUS hideFocus 设置或获取表明对象是否显式标明焦点的值。 HSPACE hspace 设置或获取对象的水平边距。 ID id 获取标识对象的字符串。 innerText 设置或获取位于对象起始和结束标签内的文本。 isContentEditable 获取表明用户是否可编辑对象内容的值。 isDisabled 获取表明用户是否可与该对象交互的值。 isMultiLine 获取表明对象的内容是包含一行还是多行的值。 isTextEdit 获取是否可使用该对象创建一个 TextRange 对象。 LANG lang 设置或获取要使用的语言。 LANGUE language 设置或获取当前脚本编写用的语言。 lastChild 获取该对象 childNodes 集合中最后一个子对象的引用。 longDesc 设置或获取对象长描述的统一标识符(URI)。 MARGINHEIGHT marginHeight 设置或获取显示框架中文本之前的上下边距高度。 MARGINWIDTH marginWidth 设置或获取显示框架中文本之前的左右边距宽度。 NAME name 设置或获取框架的名称。 nextSibling 获取对此对象的下一个兄弟对象的引用。 nodeName 获取特定结点类型的名称。 nodeType 获取所需结点的类型。 nodeValue 设置或获取结点的值。 offsetHeight 获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度。 offsetLeft 获取对象相对于版面或由 offsetParent 属性指定的父坐标的计算左侧位置。 offsetParent 获取定义对象 offsetTop 和 offsetLeft 属性的容器对象的引用。 offsetTop 获取对象相对于版面或由 offsetTop 属性指定的父坐标的计算顶端位置。 offsetWidth 获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的宽度。 onOffBehior 获取表明指定的 Microsoft? DirectAnimation? 行为是否正在运行的对象。 outerHTML 设置或获取对象及其内容的 HTML 形式。 outerText 设置或获取对象的文本。 ownerDocument 设置或获取结点关联的 document 对象。 parentElement 获取对象层次中的父对象。 parentNode 获取文档层次中的父对象。 parentTextEdit 获取文档层次中可用于创建包含原始对象的 TextRange 的容器对象。 previousSibling 获取对此对象的上一个兄弟对象的引用。 readyState 获取对象的当前状态。 readyState 获取表明对象当前状态的值。 recordNumber 获取数据集中生成对象的原始记录。 scopeName 获取为该元素定义的命名空间。 SCROLLING scrolling 设置或获取框架是否可被滚动。 SECURITY SECURITY 获取表明 frame 或 iframe 的源文件是否应用了特定的安全限制的值。 sourceIndex 获取对象在源序中的依次位置,即对象出现在 document 的 all 集合中的顺序。 SRC src 设置或获取要由对象装入的 URL。 STYLE 为该设置元素设置内嵌样式。 SYNCMASTER syncMaster 设置或获取时间容器是否必须在此元素上同步回放。 SYSTEMBITRATE 获取系统中大约可用带宽的 bps。 SYSTEMCAPTION 表明是否要显示文本来代替演示的的音频部分。 SYSTEMLANGUE 表明是否在用户计算机上的选项设置中选中了给定语言。 SYSTEMOVERDUBORSUBTITLE 指定针对那些正在观看演示但对被播放的音频所使用的语言并不熟悉的用户来说是否要渲染配音或字幕。 TABINDEX tabIndex 设置或获取定义对象的 Tab 顺序的索引。 tagName 获取对象的标签名称。 tagUrn 设置或获取在命名空间声明中指定的统一名称(URN)。 TIMECONTAINER timeContainer 设置或获取与元素关联的时间线类型。 TITLE title 设置或获取对象的咨询信息(工具提示)。 uniqueID 获取为对象自动生成的唯一标识符。 UNSELECTABLE 指定该元素不可被选中。 VSPACE vspace 设置或获取对象的垂直边距。 WIDTH width 设置或获取对象的宽度。 iframe 标签 -- 代表HTML内联框架 iframe标签是成对出现的,以<iframe>开始,</iframe>结束 属性 name -- 定义了内容页名称,此名称在框架页内链接时使用到 src -- 定义了内容页URL frameborder -- 定义了内容页的边框,取值为(1|0),缺省值为1 1 -- 在每个页面之间都显示边框 0 -- 不显示边框 marginwidth -- 定义了框架中HTML文件显示的左右边界的宽度,取值为px,缺省值由浏览器决定 marginheight -- 定义了框架中HTML文件显示的上下边界的宽度,取值为px,缺省值由浏览器决定 scrolling -- 定义是否有滚动条,取值为(yes|no|auto),缺省值为auto yes -- 显示滚动条 no -- 不显示滚动条 auto -- 当需要时再显示滚动条 align -- 垂直或水平对齐方式 height -- 框架的高度 width -- 框架的宽度

怎样在Blog里面放上每天的天气预报呢?

.T7ONLINE.COM

我刚刚学习网站制作,还没有做成一个网站呢

想在网站内加入新浪的天气预报

我首先试了一下,在自己的电脑上,用记事本编辑

<html>

<head>

</head>

<body>

<iframe src="://.7stk/1/6/sina.htm" frameborder="0" width="117" height="37" marginheight="0" marginwidth="0" scrolling="no"></iframe>

</body>

<html>

保存为html格式

打开后为什么是显示的北京的天气状况?这个代码是可以随ip变化的啊!

问题补充:新浪首页(.sina)天气预报我这里怎么也显示的是北京的天气情况?难道它不是根据ip来显示的吗?

急求可用的天气预报代码--

在添加天气预报之前,你得先添加(自定义面板),然后输入标题,勾选(显示源代码),在空白面板里粘贴如下代码,另外需要注意的是,代码显示可能不是你想要的城市,那么你就需要修改为你的城市的代码。

几段超酷实用的天气预报代码,整理如下:

第一种:

<iframe src=://weather.265/weather.htm width="160" height="54" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>

效果: <IFRAME ID='ifm2' WIDTH='189' HEIGHT='190' ALIGN='CENTER' MARGINWIDTH='0' MARGINHEIGHT='0' HSPACE='0' VSPACE='0' FRAMEBORDER='0' SCROLLING='NO' SRC='://weather.qq/inc/ss258.htm'></IFRAME>

效果: 使用方法:以上显示的是九江的天气预报,你可以改成你自己的,打开页面:://weather.qq,在右边的框中

选择你所在的城市(比如选择南京),然后打开了这个页面:://weather.qq/preend.htm?dc244.htm,然后将网址中的244替换'://weather.qq/inc/ss258.htm'中的258,那么最后显示出来的就是南京的天气预报。

第三种:

<IFRAME ID='ifm2' WIDTH='260' HEIGHT='70' ALIGN='CENTER' MARGINWIDTH='0' MARGINHEIGHT='0' HSPACE='0' VSPACE='0' FRAMEBORDER='0' SCROLLING='NO' src="://news.sina.cn/iframe/weather/130101.html"></ifreame>

效果:

第四种:

<iframe width="469" height="218" border="0" align="center" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src=://news.qq/cgi-bin/news_weather_search?city=贵阳 allowTransparency="true"></iframe>

效果:

第五种:

<IFRAME ID='ifm1' WIDTH='405' HEIGHT='332' ALIGN='center' MARGINWIDTH='0' MARGINHEIGHT='0' HSPACE='0' VSPACE='0' FRAMEBORDER='0' SCROLLING='NO' SRC="://weather.qq/24.htm"></IFRAME>

效果:

第六种:

<iframe width="145" height="130" border="0" align="center" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="://minisite.qq/Weather/news_new.html" allowTransparency="true"></iframe>

效果:

第七种:

以前很流行的一段代码(在Google上搜到的90%都是这一段),现在已经不能用了,特此写出来,以免大家浪费精力:

<iframe width="150" height="240" frameborder="0" scrolling="No" src='://news.qq/cgi-bin/news_qq_search?city=xxx'></iframe>

其中的“xxx”是每个城市的代码:比如武汉的就是%CE%E4%BA%BA

下面是其他的一些城市的编码:

上海-%C9%CF%BA%A3

北京-%B1%B1%BE%A9

青岛-%C7%E0%B5%BA

济南-%BC%C3%C4%CF

武汉-%CE%E4%BA%BA

福州-%B8%A3%D6%DD

以下得到其他城市的代码的方法:

baidu搜索一下城市的名称,比如"重庆",然后地址栏中的那个代码就是了这些中文字符如何编码变成%D6%D8%C7%EC这种的。比如得到的网址是:

://.baidu/s?wd=%D6%D8%C7%EC

后面的%D6%D8%C7%EC即是。

现在我给大家推荐一个专门提供天气预报和免费天气预报代码服务的网站:

天气123:中国城市天气预报(://.tianqi123/)

只要复制粘贴该网站提供的代码就可以了。

如下是3款(南京)效果图:

第八种:

<iframe src="://.tianqi123/small_page/chengshi_1189.html" width=160 height=248 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>

第九种:

<iframe src="://.tianqi123/small_page/chengshi_1189.html?c0=F9DC68&c1=white&c2=FEFCE0&t1=red&bg=white&w=160&text=no" width=160 height=248 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>

第十种:

<iframe src="://.tianqi123/small_page/chengshi_1189.html?c0=red&c1=FF9900&bg=F4FFF4&w=160&h=20&text=yes" width=160 height=21 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>

该天气代码高级使用方法:

如果您会HTML语言,您还可以在iframe代码中的url后面加参数,如:

chengshi_321.html?c0=F9DC68&c1=white&c2=FEFCE0&t1=red&bg=white&w=160&h=250&text=no

其中 c0 表示表格第一行背景颜色,c1,c2表示表格其他行间隔的背景颜色,t1表示标题颜色,bg 表示页面北京颜色,w表示表格宽度 h 表示表格高度

当 text=yes 时,将会出现滚动的天气文字,建议您自己调试看看,如:

chengshi_321.html?c0=red&c1=FF9900&bg=F4FFF4&w=160&h=20&text=yes

注意:颜色请不要加 # 符号,如 #FF9900 请写成 FF9900

````我的BLOG教程里面的东西 如果看着很烦琐 欢迎去我的BLOG 仔细研究

ASP.NET实现天气预报

我现在使用的是这个:

<iframe src="://weather.265/weather.htm" width="160" height="53" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>

推荐一下了~~~呵呵

其实,网上也有很多其他的~~

自己找找也可以

求天气预报代码

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

using System.Net;

using System.IO;

using System.Collections;

/// <summary>

/// Weather 的摘要说明

/// </summary>

public class Weather

{

public Weather()

{

//

// TODO: 在此处添加构造函数逻辑

//

}

public static string ConvertCodeByCity(string City)

{

string Code = "";

switch (City)

{

case "北京":

Code = "110100";

break;

default:

break;

}

return Code;

}

public static ArrayList GetWeather(string code)

{

/*

[0] "北京 "string

[1] "雷阵雨 "string

[2] "9℃" string

[3] "29℃"string

[4] "小于3级"string

*/

string html = "";

try

{

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("://weather.sina.cn/iframe/weather/" + code + "_w.html ");

request.Method = "Get";

//request.Timeout = 1;

request.ContentType = "lication/x--form-urlencoded ";

WebResponse response = request.GetResponse();

Stream s = response.GetResponseStream();

StreamReader sr = new StreamReader(s, System.Text.Encoding.GetEncoding("GB2312"));

html = sr.ReadToEnd();

s.Close();

sr.Close();

}

catch (Exception err)

{

throw new Exception("访问地址出错~~~ ");

}

int count = html.Length;

int starIndex = html.IndexOf("<table ", 0, count);

int endIndex = html.IndexOf("</table>", starIndex, count - starIndex);

html = html.Substring(starIndex, endIndex - starIndex + 8);

//得到城市

int cityStartIndex = html.IndexOf("<b>", 0, html.Length);

int cityEndIndex = html.IndexOf("</b>", 0, html.Length);

string City = html.Substring(cityStartIndex + 3, cityEndIndex - cityStartIndex - 3);

//得到天气

int weatherStartIndex = html.IndexOf("<b>", cityEndIndex);

int weatherEndIndex = html.IndexOf("</b>", weatherStartIndex);

string Weather = html.Substring(weatherStartIndex + 3, weatherEndIndex - weatherStartIndex - 3);

//得到温度

int temperatureStartIndex = html.IndexOf("<b", weatherEndIndex);

int temperatureEndIndex = html.IndexOf("</b>", weatherEndIndex + 3);

string Temperature = html.Substring(temperatureStartIndex + 21, temperatureEndIndex - temperatureStartIndex - 21);

int int1 = Temperature.IndexOf("℃", 0);

int int2 = Temperature.IndexOf("~", 0);

int int3 = Temperature.IndexOf("℃", int2);

string MinTemperature = Temperature.Substring(int2 + 1, int3 - int2);

string MaxTemperature = Temperature.Substring(0, int2 - int1 + 2);

//得到风力

int windforceStartIndex = html.IndexOf("风力:", temperatureEndIndex);

int windforceEndIndex = html.IndexOf("<br>", windforceStartIndex);

string Windforce = html.Substring(windforceStartIndex + 3, windforceEndIndex - windforceStartIndex - 3);

if (Windforce.Contains("小于") && (!Windforce.Contains("等于"))) //判断风力是否含有"小于"或"小于等于"字样将,如果有的话,将其替换为2-

{

//Windforce = Windforce.Replace("小于", "2-");

string strWindforce = Windforce.Substring(2, Windforce.Length - 3);

int minWindforce = Int32.Parse(strWindforce) - 1;

Windforce = Windforce.Replace("小于", minWindforce.ToString() + "-");

}

else if (Windforce.Contains("小于等于"))

{

string strWindforce = Windforce.Substring(4, Windforce.Length - 5);

int minWindforce = Int32.Parse(strWindforce) - 1;

Windforce = Windforce.Replace("小于等于", minWindforce.ToString() + "-");

}

ArrayList al = new ArrayList();

al.Add(City);

al.Add(Weather);

al.Add(MinTemperature);

al.Add(MaxTemperature);

al.Add(Windforce);

return al;

}

}

大家看看这段天气预报代码,为什么我把它粘贴到我的网站中,却显示3月份的天气预报?怎样才能显示当前的?

我的网站用的代码:://jj.infocom.cn酒嘉市场信息网

这是泰安的天气预报代码,看你需要那种样式

样式一代码:<iframe src="://.tianqi123/small_page/chengshi_1632.html" width=178 height=248 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>

样式二代码:<iframe src="://.tianqi123/small_page/chengshi_1632.html?c0=F9DC68&c1=white&c2=FEFCE0&t1=red&bg=white&w=178&text=no" width=178 height=248 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>

样式三滚动代码:<iframe src="://.tianqi123/small_page/chengshi_1632.html?c0=red&c1=D96C00&bg=F4FFF4&w=178&h=20&text=yes" width=178 height=21 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>

天气代码高级使用方法:

如果您会HTML语言,您还可以在iframe代码中的url后面加参数,如:

chengshi_321.html?c0=F9DC68&c1=white&c2=FEFCE0&t1=red&bg=white&w=178&h=250&text=no

其中 c0 表示 表格第一行背景颜色,c1,c2表示表格其他行间隔的背景颜色,t1表示 标题颜色,bg 表示页面北京颜色,w表示表格宽度 h 表示表格高度

当 text=yes 时,将会出现滚动的天气文字,建议您自己调试看看,如:

chengshi_321.html?c0=red&c1=FF9900&bg=F4FFF4&w=178&h=20&text=yes

注意:颜色请不要加 # 符号,如 #FF9900 请写成 FF9900

欢迎访问我的网站

用python编写的获取天气预报的代码总是有错误,求解

<iframe height="50" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" src="苏州&L=cn">

</iframe>

如果不要人家站上带的那个logo 或者想用别的风格 可以参考我的博客

吉尔毕日者/blog

里面的的天气小偷程序 自己修改哈!

weatherinfo=r.json() #在json后面加上括号才能返回结果。否则只能返回函数地址。

以下python3通过:

import?requests

ApiUrl="://.weather.cn/adat/cityinfo/101010100.html"

r=requests.get(ApiUrl)

weatherinfo=r.json()

print?(weatherinfo["weatherinfo"]["ptime"])

print?(weatherinfo["weatherinfo"]["temp2"])

>>>08:00

>>>5℃