This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 1xx: 信息响应类,表示接收到请求并且继续处理 | |
| 100——必须继续发出请求 | |
| 101——要求服务器根据请求转换HTTP协议版本 | |
| ### 2xx: 处理成功响应类,表示动作被成功接收、理解和接受 | |
| 200——交易成功 | |
| 201——提示知道新文件的URL | |
| 202——接受和处理、但处理未完成 | |
| 203——返回信息不确定或不完整 | |
| 204——请求收到,但返回信息为空 | |
| 205——服务器完成了请求,用户代理必须复位当前已经浏览过的文件 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| **HEAD**:从服务器得到除了请求体与GET请求一样的响应 | |
| **GET**:通过URL获取查询资源信息(爬虫特定URL爬取) | |
| **POST**:提交表单(爬虫中的模拟登录) | |
| **PUT**:上传文件(浏览器不支持) | |
| **DELETE**:删除 | |
| **OPTIONS**:返回服务器对特定资源支持的HTTP请求方法 | |
| **TRACE**:返回服务器收到的请求,用于测试或诊断 | |
| **CONNECT**:预留给管道连接方式的代理服务 | |
| ,是一种按照一定的规则,自动地抓取万维网信息的程序或者脚本。 | |
| ## 爬虫有什么用: | |
| > **市场分析**:电商分析、商圈分析、一二级市场分析等 | |
| > **市场监控**:电商、新闻、房源监控等 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 初识Python爬虫 | |
| ## 环境搭建 | |
| 1. 下载[Python](https://repo.anaconda.com/archive/Anaconda3-2019.03-MacOSX-x86_64.pkg) | |
| 2. 下载[chrome浏览器](https://www.google.cn/chrome/browser/desktop/index.html ) | |
| - [chrome插件](https://www.zhihu.com/question/20054116) | |
| 3. 下载[PyCharm编译器](http://www.jetbrains.com/pycharm/download/#section=windows ) | |
| ## 创建一个爬虫 | |
| 1. 安装包 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 开发Python | |
| ### 虚拟环境配置教程 | |
| - 使用虚拟环境是比不可少的,特奉上一个配置虚拟环境的教程 | |
| - 记得需要先安装`aptpthon3-pip` | |
| - 两个虚拟必备库 | |
| ``` | |
| pip3 install virtualenv | |
| pip3 install virtualenvwrapper | |
| ``` | |
| - 查看安装目录(为环境变量准备) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 安装mysql | |
| ``` | |
| sudo apt install mysql-server | |
| ``` | |
| # ubuntu18.04 首次登录mysql未设置密码或忘记密码解决方法 | |
| 1.首先输入以下指令: | |
| ```shell | |
| sudo cat /etc/mysql/debian.cnf | |
| ``` | |
| 2.输入显示的帐号与密码 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - 目标: [下载Navicat](https://www.navicat.com.cn/download/navicat-premium) | |
| - 操作: | |
| - 解压 | |
| ``` | |
| sudo tar -zxvf navicat120_premium_cs_x64.tar.gz | |
| ``` | |
| - 启动 | |
| ``` | |
| ./start_navicat | |
| ``` |