You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
946 B
30 lines
946 B
from tkinter import Tk, Label, Entry, Button, StringVar, messagebox
|
|
import 抖音
|
|
|
|
def start_fetch():
|
|
url = url_var.get()
|
|
cookie = cookie_var.get()
|
|
if url and cookie:
|
|
# 调用 douyin.py 中的函数,并传递 URL 和 Cookie
|
|
抖音.chuancan(url, cookie)
|
|
else:
|
|
messagebox.showwarning("警告", "请输入URL和Cookie")
|
|
|
|
# 创建 GUI
|
|
root = Tk()
|
|
root.title("抖音评论抓取")
|
|
|
|
# URL 标签和输入框
|
|
Label(root, text="URL:").grid(row=0, column=0, padx=10, pady=10)
|
|
url_var = StringVar()
|
|
Entry(root, textvariable=url_var, width=50).grid(row=0, column=1, padx=10, pady=10)
|
|
|
|
# Cookie 标签和输入框
|
|
Label(root, text="Cookie:").grid(row=1, column=0, padx=10, pady=10)
|
|
cookie_var = StringVar()
|
|
Entry(root, textvariable=cookie_var, width=50).grid(row=1, column=1, padx=10, pady=10)
|
|
|
|
# 提交按钮
|
|
Button(root, text="开始抓取", command=start_fetch).grid(row=2, columnspan=2, pady=10)
|
|
|
|
root.mainloop() |