# -*- coding: utf-8 -*- # @Author: wangkun # @Time: 2023/2/13 # import argparse import os import sys sys.path.append(os.getcwd()) from common.common import Common from weixinzhishu.weixinzhishu_score.weixinzhishu_score import Weixinzhishu class Main: @classmethod def main(cls, log_type, crawler, env): if env == "dev": host = 'http://testhot-words-internal.piaoquantv.com' else: host = 'http://hot-words-internal.piaoquantv.com' Common.logger(log_type, crawler).info("开始抓取微信指数\n") Weixinzhishu.get_wechat_score(log_type, crawler, host) Common.del_logs(log_type, crawler) if __name__ == "__main__": # parser = argparse.ArgumentParser() ## 新建参数解释器对象 # parser.add_argument('--log_type', type=str) ## 添加参数,注明参数类型 # parser.add_argument('--crawler') ## 添加参数 # parser.add_argument('--strategy') ## 添加参数 # parser.add_argument('--our_uid') ## 添加参数 # parser.add_argument('--oss_endpoint') ## 添加参数 # parser.add_argument('--env') ## 添加参数 # parser.add_argument('--machine') ## 添加参数 # args = parser.parse_args() ### 参数赋值,也可以通过终端赋值 # # print(args) # Main.main(log_type=args.log_type, crawler=args.crawler) Main.main("weixin", "weixinzhishu", "prod")