run_shipinhao_recommend.py 793 B

1234567891011121314151617181920212223242526272829303132
  1. # -*- coding: utf-8 -*-
  2. # @Author: wangkun
  3. # @Time: 2022/8/31
  4. import datetime
  5. import os
  6. import sys
  7. import time
  8. from main.download_publish import Download
  9. sys.path.append(os.getcwd())
  10. # from crawler_shipinhao.main.common import Common
  11. # from crawler_shipinhao.main.shipinhao_recommend import Recommend
  12. from main.common import Common
  13. from main.shipinhao_recommend import Recommend
  14. class Main:
  15. @classmethod
  16. def main(cls, env):
  17. while True:
  18. if 20 >= datetime.datetime.now().hour >= 10:
  19. Recommend.start_wechat('recommend')
  20. Download.run_download_publish('recommend', env)
  21. Common.del_logs('recommend')
  22. time.sleep(5)
  23. else:
  24. pass
  25. if __name__ == '__main__':
  26. Main.main('dev')