main.py 983 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. '''
  4. @Contact : liuyuqi.gov@msn.cn
  5. @Time : 2023/12/03 03:09:35
  6. @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
  7. @Desc : enter point
  8. 多个功能,整理成命令行参数执行
  9. '''
  10. from crawl_sse import Sse
  11. from crawl_sse import Cninfo
  12. from crawl_sse.options import parse_args
  13. import sys
  14. if __name__=='__main__':
  15. args = parse_args()
  16. if args['command'] == 'crawl':
  17. if args['extractor'] == 'sse':
  18. sse = Sse()
  19. sse.crawl()
  20. elif args['extractor'] == 'cninfo':
  21. cninfo = Cninfo()
  22. cninfo.crawl()
  23. elif args['command'] == 'download':
  24. if args['extractor'] == 'cninfo':
  25. cninfo =Cninfo()
  26. cninfo.download()
  27. elif args['command'] == 'help':
  28. pass
  29. elif args['command'] == 'version':
  30. print('1.0.0')
  31. else:
  32. print('command error, please use --help to get help')
  33. sys.exit(1)