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 | |
``` |
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
# 开发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
# 初识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
# 什么是爬虫? | |
## 爬虫的定义: | |
> 网络爬虫(又被称为网页蜘蛛,网络机器人,在FOAF社区中间,更经常的称为网页追逐者),是一种按照一定的规则,自动地抓取万维网信息的程序或者脚本。 | |
## 爬虫有什么用: | |
> **市场分析**:电商分析、商圈分析、一二级市场分析等 | |
> **市场监控**:电商、新闻、房源监控等 |
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
1.先把项目传到服务器上 | |
文件上传 | |
1、把本机的文件传给目的服务器 | |
``` | |
scp 文件 [email protected]:/目录 | |
``` | |
2、在本机上执行scp,把远端的服务器文件拷贝到本机上: | |
``` | |
scp [email protected]:目录 / |
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
1.安装必要库 | |
``` | |
apt-get -y install git bc | |
``` | |
2.下载生成ssl证书的项目 | |
``` | |
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt | |
``` | |
3.继续生成证书必须要先停止现在的nginx | |
``` |
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
**Accept**:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 | |
**含义**:告诉浏览器我们接受MIME的类型 | |
--- | |
**Accept-Encoding**:gzip, deflate, br | |
**含义**:如果有这个字段,则代表客户端支持压缩将内容编码,去掉后会支持任意编码。 |
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**:预留给管道连接方式的代理服务 | |
![微信图片_20190213212012.jpg](data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAeAB4AAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAEcAjADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba |
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——服务器完成了请求,用户代理必须复位当前已经浏览过的文件 |