v1:初始化engine,将请求区分开

This commit is contained in:
2026-06-09 20:33:50 +08:00
parent 924e8c88d2
commit 0dc1f05265
3 changed files with 22 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2026/6/9 20:28
# @Author : cmk
# @File : __init__.py.py
# @Email : 15726649712@163.com
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2026/6/9 20:30
# @Author : cmk
# @File : engine.py
# @Email : 15726649712@163.com
class Engine():
def __init__(self):
pass
def start_spider(self,spider):
start_url = spider.start_requests()
+3 -2
View File
@@ -5,7 +5,7 @@
# @File : baidu.py
# @Email : 15726649712@163.com
import requests
from bald_spider.core.engine import Engine
class Baidu_Spider():
start_urls = ['https://www.baidu.com/']
@@ -17,4 +17,5 @@ class Baidu_Spider():
if __name__ == '__main__':
spider = Baidu_Spider()
spider.start_requests()
engine = Engine()
engine.start_spider(spider)