源码地址:https://gitee.com/pojoin/h3blog
有做SEO的朋友问我能不能做一个百度关键词排名查询工具,作为技术的我那当然是可以的,而且我觉得用python开发还是相对比较简单
这个工具界面设计相对比较简单,只需要输入关键词(支持多个关键词,使用英文逗号隔开即可)、域名,然后点击查询按钮即可,下面输出查询结果
from tkinter import Button, Entry, Label, StringVar, Tk, ENDfrom tkinter.scrolledtext import ScrolledText#文本滚动条 from service import BaiduRankServiceclass MyGui(): def __init__(self) -> None: self.win = Tk() self.win.title('百度关键词排名查询工具-作者何三(www.h3blog.com)') self.win.geometry('+600+100') #窗口呈现位置 self.keywords = StringVar(value='何三笔记') self.domain = StringVar(value='www.h3blog.com') Label(self.win,text='何三笔记(www.h3blog.com)', font=('微软雅黑',20)).grid(row=0, column=1) Label(self.win, text='关键词').grid(row=1) Entry(self.win, textvariable=self.keywords ,width=70).grid(row=1, column=1) Label(self.win, text='域 名').grid(row=2) Entry(self.win, textvariable=self.domain ,width=70).grid(row=2, column=1) Button(self.win,text='PC端查询', command= self.search).grid(row = 1,column=2) # Button(self.win, text='手机端查询', command= self.mobile_search).grid(row = 1,column=2) self.st = ScrolledText(self.win,font=('微软雅黑',10),fg='blue',height=20, width=100) self.st.grid(row=3,column=0,rowspan=3,columnspan=3) def search(self): bs = BaiduRankService(self.st,self.keywords.get(), self.domain.get() ) bs.setDaemon(False) bs.start() def mobile_search(self): bs = BaiduRankService(self.st,self.keywords.get(), self.domain.get() , terminal_type='mobile') bs.setDaemon(False) bs.start() def start(self): self.win.mainloop()if __name__ == '__main__': gui = MyGui() gui.start()
目前该工具正在开发手机端百度关键词排名情况的查看功能
关注
“何三笔记” 回复”百度查排名工具” 进行获取下载地址