From e26bf9960aff09fec034d064ee6dc54b1a32751f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=20=E6=B4=9B?= <2724070804@qq.com> Date: Thu, 25 Apr 2024 23:03:03 +0800 Subject: [PATCH] =?UTF-8?q?ui=E4=BF=AE=E6=94=B9bug=EF=BC=8C=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/UIController.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/controller/UIController.py b/controller/UIController.py index dd7e284..5c24261 100644 --- a/controller/UIController.py +++ b/controller/UIController.py @@ -5,7 +5,7 @@ from entity.BilibiliVideo import BilibiliVideo from service.IFileService import IFileService from service.CsvService import CsvService from service.ExcelService import ExcelService - +import re @@ -50,11 +50,7 @@ class UIController: threadCount=eval(threadCount) else: return print("thread count is not num ") - if waitTime.isdigit(): - waitTime=eval(waitTime) - else: - return print("waitTime is not num") - #创建 SpyderController对象调用其函数 + waitTime=float(waitTime) SpyderController=SC.SpyderController() self.scRuslt_data=SpyderController.getBilibiliVideoList(videoCount,threadCount,waitTime) @@ -72,6 +68,7 @@ class UIController: # self.scRuslt_data=text_date if self.scRuslt_data is None: return print("爬取数据实体类为空") + index=0 for data in self.scRuslt_data: theList = [] theList.append(data.bvId) @@ -89,6 +86,7 @@ class UIController: theList.append(data.creatorId) theList.append(data.creatorName) theList.append(data.creatorFanCount) + theList.append(index) tree.insert("", "end", values=theList) def button_save_to_exce_click(): @@ -139,7 +137,7 @@ class UIController: tree.heading("#2", text="title") tree.heading('#3', text="url") tree.heading('#4', text="uploadtime") - tree.heading('#5', text="uploadtimeTexT") + tree.heading('#5', text="uploadtimeText") tree.heading('#6', text="topNo") tree.heading('#7', text="ViewCount") tree.heading('#8', text="likeCount")