|
|
@ -37,12 +37,28 @@ class UIController:
|
|
|
|
videoCount=entry1.get()
|
|
|
|
videoCount=entry1.get()
|
|
|
|
threadCount = entry2.get()
|
|
|
|
threadCount = entry2.get()
|
|
|
|
waitTime = entry3.get()
|
|
|
|
waitTime = entry3.get()
|
|
|
|
|
|
|
|
if(videoCount==''):
|
|
|
|
|
|
|
|
videoCount=999
|
|
|
|
|
|
|
|
threadCount=10
|
|
|
|
|
|
|
|
waitTime=0.3
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
if videoCount.isdigit():
|
|
|
|
|
|
|
|
videoCount=eval(videoCount)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
return print("video count is not digit")
|
|
|
|
|
|
|
|
if threadCount.isdigit():
|
|
|
|
|
|
|
|
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对象调用其函数
|
|
|
|
#创建 SpyderController对象调用其函数
|
|
|
|
SpyderController=SC.SpyderController()
|
|
|
|
SpyderController=SC.SpyderController()
|
|
|
|
# global scRuslt_data
|
|
|
|
|
|
|
|
self.scRuslt_data=SpyderController.getBilibiliVideoList(videoCount,threadCount,waitTime)
|
|
|
|
self.scRuslt_data=SpyderController.getBilibiliVideoList(videoCount,threadCount,waitTime)
|
|
|
|
print("爬取完成")
|
|
|
|
print("爬取完成")
|
|
|
|
# print(scRuslt_data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -61,6 +77,8 @@ class UIController:
|
|
|
|
theList.append(data.bvId)
|
|
|
|
theList.append(data.bvId)
|
|
|
|
theList.append(data.title)
|
|
|
|
theList.append(data.title)
|
|
|
|
theList.append(data.url)
|
|
|
|
theList.append(data.url)
|
|
|
|
|
|
|
|
theList.append(data.uploadTime)
|
|
|
|
|
|
|
|
theList.append(data.uploadTimeText)
|
|
|
|
theList.append(data.topNo)
|
|
|
|
theList.append(data.topNo)
|
|
|
|
theList.append(data.viewCount)
|
|
|
|
theList.append(data.viewCount)
|
|
|
|
theList.append(data.likeCount)
|
|
|
|
theList.append(data.likeCount)
|
|
|
@ -116,21 +134,22 @@ class UIController:
|
|
|
|
button_save_to_csv = tk.Button(root, text="save to csv", command=button_save_to_csv_click)
|
|
|
|
button_save_to_csv = tk.Button(root, text="save to csv", command=button_save_to_csv_click)
|
|
|
|
button_save_to_csv.grid(row=6, column=1,sticky=tk.W)
|
|
|
|
button_save_to_csv.grid(row=6, column=1,sticky=tk.W)
|
|
|
|
# 创建一个带展示框
|
|
|
|
# 创建一个带展示框
|
|
|
|
tree = ttk.Treeview(root, columns=("bvid", "title","url","upload","topNo","viewCount","likeCount","coinCount","favorite","commentCount","bolletCount","creatorld","creatorName","createFanCount"))
|
|
|
|
tree = ttk.Treeview(root, columns=("bvid", "title","url",'uploadTime',"uploadTimeText","topNo","viewCount","likeCount","coinCount","favorite","commentCount","bolletCount","creatorld","creatorName","createFanCount"))
|
|
|
|
tree.heading("#1", text="bvid")
|
|
|
|
tree.heading("#1", text="bvid")
|
|
|
|
tree.heading("#2", text="title")
|
|
|
|
tree.heading("#2", text="title")
|
|
|
|
tree.heading('#3', text="url")
|
|
|
|
tree.heading('#3', text="url")
|
|
|
|
tree.heading('#4', text="upload")
|
|
|
|
tree.heading('#4', text="uploadtime")
|
|
|
|
tree.heading('#5', text="topNo")
|
|
|
|
tree.heading('#5', text="uploadtimeTexT")
|
|
|
|
tree.heading('#6', text="ViewCount")
|
|
|
|
tree.heading('#6', text="topNo")
|
|
|
|
tree.heading('#7', text="likeCount")
|
|
|
|
tree.heading('#7', text="ViewCount")
|
|
|
|
tree.heading('#8', text="coinCount")
|
|
|
|
tree.heading('#8', text="likeCount")
|
|
|
|
tree.heading('#9', text="favorite")
|
|
|
|
tree.heading('#9', text="coinCount")
|
|
|
|
tree.heading('#10', text="commentCount")
|
|
|
|
tree.heading('#10', text="favorite")
|
|
|
|
tree.heading('#11', text="bulletCount")
|
|
|
|
tree.heading('#11', text="commentCount")
|
|
|
|
tree.heading('#12', text="creadtorId")
|
|
|
|
tree.heading('#12', text="bulletCount")
|
|
|
|
tree.heading('#13', text="creatorName")
|
|
|
|
tree.heading('#13', text="creadtorId")
|
|
|
|
tree.heading('#14', text="createFanCount")
|
|
|
|
tree.heading('#14', text="creatorName")
|
|
|
|
|
|
|
|
tree.heading('#15', text="createFanCount")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 向展示框添加数据
|
|
|
|
# 向展示框添加数据
|
|
|
|