Skip to content

Commit 1329ca7

Browse files
committed
feat: 数据存储实现
1 parent 1b8ebe5 commit 1329ca7

File tree

22 files changed

+1130
-56
lines changed

22 files changed

+1130
-56
lines changed

README.md

Lines changed: 15 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
11
## 关于作者
22
大家好,我是程序员阿江-Relakkes,近期我会给大家出一些爬虫方面的教程,爬虫入门、进阶、高级都有,有需要的朋友,star仓库并持续关注本仓库的更新。
3+
34
### 基本信息
4-
- [Github万星爬虫仓库作者](https://github.com/NanmiCoder/MediaCrawler)
5+
- [自媒体爬虫MediaCrawler作者](https://github.com/NanmiCoder/MediaCrawler)
56
- 全栈程序员,熟悉Python、Golang、JavaScript,工作中主要用Golang。
67
- 曾经主导并参与过百万级爬虫采集系统架构设计与编码
78
- 爬虫是一种技术兴趣爱好,参与爬虫有一种对抗的感觉,越难越兴奋。
89

9-
### 视频教程
10-
> 自媒体账号名: 程序员阿江-Relakkes
11-
- B站:https://space.bilibili.com/434377496
12-
- 小红书:https://www.xiaohongshu.com/user/profile/5f58bd990000000001003753
13-
- 抖音:https://www.douyin.com/user/MS4wLjABAAAATJPY7LAlaa5X-c8uNdWkvz0jUGgpw4eeXIwu_8BhvqE
14-
15-
### 怎么联系我?
16-
17-
- Wechat:yzglan
18-
- QQ: 524134442
19-
20-
### 支持我
21-
> 现在工作中基本都是面向GPT编程了,大家帮我注册一下,你们也可以每天获得免费GPT聊天次数。
22-
23-
<a href="https://sider.ai/ad-land-redirect?source=github&p1=mi&p2=kk">通过注册这个款免费的GPT助手,帮我获取GPT4额度作为支持。也是我每天在用的一款chrome AI助手插件</a>
24-
<a href="https://sider.ai/ad-land-redirect?source=github&p1=mi&p2=kk" target="_blank"><img src="https://s2.loli.net/2024/04/01/jK8drZ2bxTg67q9.png" ></a>
25-
26-
27-
2810
## 爬虫入门
2911
### 爬虫入门教程目录大纲
3012
- [x] [01_为什么要写这个爬虫教程](爬虫入门/01_为什么要写这个爬虫教程.md)
@@ -36,41 +18,30 @@
3618
- [x] [07_Python常见的网络请求库](爬虫入门/07_Python常见的网络请求库.md)
3719
- [x] [08_爬虫入门实战1_静态网页数据提取](爬虫入门/08_爬虫入门实战1_静态网页数据提取.md)
3820
- [x] [09_爬虫入门实战2_动态数据提取](爬虫入门/09_爬虫入门实战2_动态数据提取.md)
39-
- [ ] [10_爬虫入门实战3_数据存储实现](爬虫入门/10_爬虫入门实战3_数据存储实现.md)
21+
- [x] [10_爬虫入门实战3_数据存储实现](爬虫入门/10_爬虫入门实战3_数据存储实现.md)
4022
- [ ] [11_爬虫入门实战4_高效率的爬虫实现](爬虫入门/11_爬虫入门实战4_高效率的爬虫实现.md)
4123
- [ ] [12_爬虫入门实战5_编写易于维护的爬虫代码](爬虫入门/12_爬虫入门实战5_编写易于维护的爬虫代码.md)
4224

43-
## 打赏
44-
免费开源不易,如果项目帮到你了,可以给我打赏哦,您的支持就是我最大的动力!
45-
<div style="display: flex;justify-content: space-between;width: 100%">
46-
<p><img alt="打赏-微信" src="static/images/wechat_pay.jpeg" style="width: 200px;height: 100%" ></p>
47-
<p><img alt="打赏-支付宝" src="static/images/zfb_pay.png" style="width: 200px;height: 100%" ></p>
48-
</div>
25+
## 问题解答
26+
> 正向的激励,我决定开通一个该爬虫教程专属的知识星球,也算是对我知识付费的一种支持,大家有能力的可以支持一下,这样我就可以有更多的动力去更新教程了。
27+
>
28+
> 多年编程+爬虫经验分享,提供知识星球服务,主动提问,我会定期回答问题
29+
>
30+
> Github这个教程我也会坚持写下去,但是**我更希望的是大家到知识星球去催更**,我**首发**在知识星球上(大家付费催更,给我的感觉不一样,我感觉欠你们的,所以你们懂的...)
31+
<p>
32+
<img alt="星球图片" src="static/images/知识星球.png" style="width: auto ;height: 300px" >
33+
</p>
4934
50-
## 爬虫教程交流群:
51-
> > 7天有效期,自动更新, 如果人满了或者二维码过期了可以加作者微信拉进群: yzglan,备注:github爬虫教程.
52-
<p><img alt="交流群二维码" src="static/images/qrcode/1.JPG" style="width: 200px;height: 100%" ></p>
35+
## 爬虫交流群
36+
可以加作者wx拉进群: yzglan,备注来自github爬虫教程.
5337

54-
### 爬虫入门教程源代码
55-
5638
## 爬虫进阶
57-
### 爬虫进阶教程目录大纲
58-
todo
59-
### 爬虫进阶教程源代码
60-
todo
61-
62-
63-
6439
## 高级爬虫
65-
### 高级爬虫教程目录大纲
66-
todo
67-
### 高级爬虫教程源代码
68-
todo
69-
7040

7141
## 免责声明
7242
>本仓库的所有内容仅供学习和参考之用,禁止用于商业用途。任何人或组织不得将本仓库的内容用于非法用途或侵犯他人合法权益。本仓库所涉及的爬虫技术仅用于学习和研究,不得用于对其他平台进行大规模爬虫或其他非法行为。对于因使用本仓库内容而引起的任何法律责任,本仓库不承担任何责任。使用本仓库的内容即表示您同意本免责声明的所有条款和条件。
7343
44+
7445
## Star History
7546

7647
[![Star History Chart](https://api.star-history.com/svg?repos=NanmiCoder/CrawlerTutorial&type=Date)](https://star-history.com/#NanmiCoder/CrawlerTutorial&Date)

static/images/1000000013.png

101 KB
Loading

static/images/1000000014.png

66.1 KB
Loading

static/images/qrcode/1.JPG

-1.48 KB
Loading

static/images/知识星球.png

192 KB
Loading

源代码/爬虫入门/08_爬虫入门实战1_静态网页数据提取/001_网页数据提取代码.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
# @Time : 2024/3/27 22:47
55
# @Desc : 分别使用两个库演示如何提取html文档结构数据
66
from bs4 import BeautifulSoup
7-
from parsel import Selector
8-
97
from common import NoteContent
8+
from parsel import Selector
109

1110

1211
def parse_html_use_bs(html_content: str):

源代码/爬虫入门/08_爬虫入门实战1_静态网页数据提取/002_源码实现_同步版本.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import requests
1010
from bs4 import BeautifulSoup
11-
1211
from common import NoteContent, NoteContentDetail, NotePushComment
1312

1413
FIRST_N_PAGE = 10 # 前N页的论坛帖子数据

源代码/爬虫入门/08_爬虫入门实战1_静态网页数据提取/003_源码实现_异步版本.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
from typing import List
88

99
import httpx
10-
from parsel import Selector
11-
1210
from common import NoteContent, NoteContentDetail, NotePushComment
11+
from parsel import Selector
1312

1413
FIRST_N_PAGE = 10 # 前N页的论坛帖子数据
1514
BASE_HOST = "https://www.ptt.cc"

源代码/爬虫入门/09_爬虫入门实战2_动态数据提取/001_curl_to_request.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
# @Desc : 下面代码是通过从chrom浏览器复制请求的curl命令转成python的代码,转换地址:https://hasdata.com/curl-to-python-converter
66
# @Desc : 今日的目标站点是雅虎财经的国外站点,他们已经关闭了中国大陆访问,所以需要开启全局VPN(科学上网工具)才能获得目标数据。
77

8-
import requests
98
import pprint
109

10+
import requests
11+
1112
cookies = {
1213
'GUC': 'AQEBCAFmDYVmOUIdcARM&s=AQAAANxlE2ny&g=Zgw0yA',
1314
'A1': 'd=AQABBBB0fGQCEKnzzPnIHq8Lm4HEj-GCp50FEgEBCAGFDWY5Zliia3sB_eMBAAcIEHR8ZOGCp50&S=AQAAAgF-nCWw8AxSZ-gyIaeg4aI',

源代码/爬虫入门/09_爬虫入门实战2_动态数据提取/002_源码实现_同步版本.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
import csv
88
import random
99
import time
10-
from typing import List, Dict, Any
10+
from typing import Any, Dict, List
1111

1212
import requests
13-
1413
from common import SymbolContent, make_req_params_and_headers
1514

1615
HOST = "https://query1.finance.yahoo.com"

0 commit comments

Comments
 (0)