fmujie 发布的文章

Vue learning(进阶)第一篇


vue命令工具的安装官网https://github.com/vuejs/vue-cli#最新版本确认 $ npm show vue-cli #安装 $ npm install -g [email protected] #安装版本确认 $ npm -V #命令帮助 $ vue -hvue-cli命令选项init 初始化Projectlist 当前可用的模板build 组件打包发布help [cmd]$ vue help init Usage: vue-init <template-name> [project-name] Options: -c, --clone use git clone --offline use cached template -h, --help output usage information...

ES6 learning(入门)第一记


let命令用let命令限定作用域变量 i 的作用域//ES5 if (true) { var i = 1; } console.log(i);//ES6 if (true) { let i = 1; } console.log(i)重复定义var i = 0; switch (i) { case 0: let value = "hello"; case 1: let value = "world"; }常量定义const关键字const data = 10; console.log(data); //data = 100 //执行错误const list = [10, 20, 30]; console.log(list); list[0] = 100; c...

Python爬虫第一幕


什么是UrllibPython内置的HTTP请求库urllib.request 请求模块urllib.error 异常处理模块urllib.parse url解析模块url.robotparser robots.txt解析模块urllib相比于Python2的变化Python2import urllib2 response = urllib.urlopen('http://www.baidu.com')Python3import urllib.request response = urllib.request.urlopen('http://www.baidu.com')

爬虫须知


爬虫基本流程发起请求通过HTTP库向目标站点发起请求,即发送一个Request,请求可以包含额外的headers等信息,等待服务器响应。获取响应内容如果服务器能正常响应,会得到一个Response,Response的内容便是所要获取的页面内容,类型可能有HTML、Json字符串、二进制数据(如图片视频)等类型。解析内容得到的内容可能时HTML,可以用正则表达式、网页解析库进行解析。可能是Json,可以直接转为Json对象解析,可能是二进制数据,可以做保存或者进一步处理。保存数据保存形式多样,可以存为文本也可以保存至数据库,或者保存特定格式的文件。Request和Response(1)浏览器就发送消息给该网址所在的服务器,这个过程叫做HTTP Request。(2)服务器收到浏览器发送的消息后,能够根据浏览器发送消息的内容做相应的处理,然后把消息回传给浏览器。这...

Vue leaning(入门)第四弹


组件:基础的基础组件 (Component, portlet)组件就是页面上的一小块区域内容,完成一个小的页面功能<div id="myApp"> <today-weather></today-weather> </div> <script> Vue.component('today-weather', { template: '<div>今天下雨,出不去啦,干什么呢?看YouTube吧!</div>' }); var myApp = new Vue({ el: '#myApp', }); </scrip...

召唤看板娘