pampas

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

12 2014 档案

摘要:通过中国天气网的通用接口查询天气。#coding:utf-8import urllib2, jsonfrom city import cityyourcity = raw_input("你想查那个城市的天气?")#yourcity = '杭州'url = "http://www.weather.co... 阅读全文
posted @ 2014-12-25 11:23 pampas 阅读(440) 评论(0) 推荐(0)

摘要:http://m.weather.com.cn/data5/city.xml返回所有省/直辖市的编号01|北京,02|上海,03|天津,04|重庆,05|黑龙江,06|吉林,07|辽宁,08|内蒙古,09|河北,10|山西,11|陕西,12|山东,13|新疆,14|西藏,15|青海,16|甘肃,17... 阅读全文
posted @ 2014-12-22 22:10 pampas 阅读(1148) 评论(0) 推荐(0)

摘要:使用BeautifulSoup抓取门户网站上的所有跳转链接from bs4 import BeautifulSoupimport urllib2request = urllib2.Request('http://www.163.com')response = urllib2.urlopen(requ... 阅读全文
posted @ 2014-12-16 18:25 pampas 阅读(8680) 评论(0) 推荐(0)

摘要:以下代码,在执行结果中的中文出现乱码。from bs4 import BeautifulSoupimport urllib2request = urllib2.Request('http://www.163.com')response = urllib2.urlopen(request)html_d... 阅读全文
posted @ 2014-12-16 14:59 pampas 阅读(1449) 评论(0) 推荐(0)

摘要:JS实现AES过程。function getAesString(str,keyObj) { var lengthKeyObj = keyObj||get_rand_key(0); var key = CryptoJS.enc.Hex.parse(lengthKeyObj.rand_key... 阅读全文
posted @ 2014-12-06 13:49 pampas 阅读(1864) 评论(0) 推荐(0)

摘要:路由器get_rand_key.cgi返回用于后续AES加密的随机数,该返回值是字典。如下代码,print pagetext返回字典{"rand_key":"c9d8b128f26058c5a684a212100bba0204beaf1795d227da4601869dd83045cd"}print... 阅读全文
posted @ 2014-12-04 12:24 pampas 阅读(18974) 评论(0) 推荐(0)