修改readme,以及不知原因的list必须改为List,在部分机器上报错。猜测原因是python版本。

Excel
Timmoc 10 months ago
parent 514040969a
commit 9e1f7826eb

@ -8,14 +8,10 @@ B站的热门榜数据具有极高的研究价值和应用前景。视频的播
开发一个针对B站的爬虫项目实现对B站数据的自动化抓取和分析对于学术研究、商业分析还是个人兴趣探索都具有重要意义。
![](assets/2024-04-26-10-47-09-image.png)
<img src="assets/2024-04-26-10-47-09-image.png" title="" alt="" data-align="center">
<center>良好的git分支管理</center>
![](assets/2024-04-26-10-50-50-image.png)
<center>项目结构展示</center>

@ -1,10 +1,12 @@
from typing import List
from service.IFileService import IFileService
from entity.BilibiliVideo import BilibiliVideo
from controller.SpyderController import SpyderController
import csv
class CsvService(IFileService):
def save(self, filePath, videoList: list[BilibiliVideo]):
def save(self, filePath, videoList: List[BilibiliVideo]):
f = open(filePath+".csv", "w", encoding="GB18030", newline="")
csv_writer = csv.writer(f)
csv_writer.writerow(

@ -1,3 +1,5 @@
from typing import List
from service.IFileService import IFileService
from entity.BilibiliVideo import BilibiliVideo
@ -9,5 +11,5 @@ class ExcelService(IFileService):
"""
pass
def save(self, filePath, videoList: list[BilibiliVideo]):
def save(self, filePath, videoList: List[BilibiliVideo]):
raise NotImplementedError

@ -1,11 +1,12 @@
from abc import abstractmethod, ABCMeta
from typing import List
from entity.BilibiliVideo import BilibiliVideo
class IFileService(metaclass=ABCMeta):
@abstractmethod
def save(self,filePath,videoList:list[BilibiliVideo]):
def save(self,filePath,videoList:List[BilibiliVideo]):
"""
保存到文件高级参数在init里面写
:param filePath: 文件保存路径

Loading…
Cancel
Save