# 以下代码基于 CI 框架 # public function history_draw($page = 0) { set_time_limit(0); $page++; $up2now = date('Y-m-d'); $fp = fsockopen('www.cwl.gov.cn', 80, $errno, $errstr, 60) or die('fsockopen失败:' . $errno . $errstr); $out = <<<EOL GET http://www.cwl…
父组件主动获取子组件的数据和方法 1.调用子组件的时候 定义一个ref <headerchild ref="headerChild"></headerchild> 2.在父组件里面通过 this.$refs.headerChild.属性 t his.$refs.headerChild.方法 子组件主动获取父组件的数据和方法 this.$parent.属性 this.$parent.方法…
http://download.csdn.net/detail/sun6223508/8011669      里面的一切..可完全移植 版权声明:本文博主原创文章.博客,未经同意不得转载.…
[本文出自天外归云的博客园] 1. 在安卓网上对热门机型进行爬网,取前五十: # -*- coding: utf-8 -*- import requests,re from bs4 import BeautifulSoup def get_rank_list(): s = requests.Session() rank_list = [] for pageNum in xrange(1,10): url = "http://product.hiapk.com/mobile/p"+str…
Header.vue <template> <div> <h2>我是头部组件</h2> <button @click="getParentData()">获取子组件的数据和方法</button> </div> </template> <script> export default{ data(){ return{ msg:'子组件的msg' } }, methods:{ run(…
一. 浏览网页的时候,发送的请求.服务器反回来的永远是字符串,由于服务器后台使用的语言不通,所以就需要用工具反解,这里用到了json json方法一 json.loads()将字符串转化为python的基本数据类型(内部必须是双引号) 中国天气网城市代码网络接口来 代码实现: req = urllib.request.Request("http://www.weather.com.cn/adat/sk/101010300.html") r = urllib.request.urlope…
中国天气网接口地址:”http://wthrcdn.etouch.cn/WeatherApi?citykey=” + weatherCityCode(为城市code); 下面是转化过程中我们需要用到的方法(序列化的实体类在文章结尾附) string weatherInfoUrl = "http://wthrcdn.etouch.cn/WeatherApi?citykey=" + weatherCityCode; string weatherstr = getHtml2(weatherI…
原文地址: https://blog.csdn.net/edogawachia/article/details/85340636 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/edogawachia/article/details/85340636 ---------------------------------------------------------------------…
1.创建项目 在你存放项目的目录下,按shift+鼠标右键打开命令行,输入命令创建项目: PS F:\ScrapyProject> scrapy startproject weather # weather是项目名称 回车即创建成功 这个命令其实创建了一个文件夹而已,里面包含了框架规定的文件和子文件夹. 我们要做的就是编辑其中的一部分文件即可. 其实scrapy构建爬虫就像填空.这么一想就很简单了 cmd执行命令: PS F:\ScrapyProject> cd weather #进入刚刚创建…
http://www.weather.com.cn/data/sk/101010100.html http://www.weather.com.cn/data/cityinfo/101010100.html http://m.weather.com.cn/data/101010100.html 这三个已经停用,数据不再更新,即使修改Referer,得到的已经不是正确的信息. 官网提供的API 一.调用规范 规范用于指导三方合作伙伴合理调用指数.3天常规预报(24小时)预报服务数据. 请求方式:h…