作品展示!!!


部分代碼展示
'''
tkinter界面設定
'''
win = tkinter.Tk()
win.title("淘寶資料")
win.geometry("1050x500+40+30")
image2 = Image.open(r'D:\Desktop\C~O)OKLBO]{3H{KE$J4%12M.png')
background_image = ImageTk.PhotoImage(image2)
background_label = Label(win, image=background_image)
background_label.place(x=0, y=0, relwidth=1, relheight=1)
# # 表格
tree = ttk.Treeview(win)
tree.pack()
tree.place(x=0,y=0)
# 定義列
tree["columns"] = ("itemname", "shoptitle", "sellernickname", "promotionprice","price","monthsellcount","provcity","url")
# 設定列,列還不顯示
tree.column("itemname", width=100)
tree.column("shoptitle", width=100)
tree.column("sellernickname", width=100)
tree.column("promotionprice", width=50)
tree.column("price", width=50)
tree.column("monthsellcount", width=50)
tree.column("provcity", width=70)
tree.column("url", width=1000)
# 設定表頭
tree.heading("itemname", text="產品名稱")
tree.heading("shoptitle", text="店名")
tree.heading("sellernickname", text="賣家小名")
tree.heading("promotionprice", text="促銷價格")
tree.heading("price", text="原價")
tree.heading("monthsellcount", text="月銷量")
tree.heading("provcity", text="發貨地")
tree.heading("url", text="網址")
e = tkinter.Variable()
path_entry = tkinter.Entry(win, textvariable=e,width=60)
path_entry.pack()
path_entry.place(x=43, y=260)
e.set("請填寫csv檔案的絕對路徑")
label_num=tkinter.Label(win,text='page_num')
label_num.pack()
label_num.place(x=0,y=230)
label_word=tkinter.Label(win,text='key_word')
label_word.pack()
label_word.place(x=130,y=230)
label_save=tkinter.Label(win,text="保存到")
label_save.pack()
label_save.place(x=0,y=260)
num = tkinter.Entry(win, width=8)
num.pack()
num.place(x=67, y=230)
w = tkinter.Entry(win, width=20)
w.pack()
w.place(x=188, y=230)
button1=tkinter.Button(win,text="退出",command=win.quit)
button1.pack(side="bottom")
button2=tkinter.Button(win,text="一鍵爬取+保存",command=save_to_csv)
button2.pack()
button2.place(x=450,y=260)
win.mainloop()
私信可發原始碼!
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/304989.html
標籤:其他
