Browse Source

Automatic Commit By liuyuqi

liuyuqi-dellpc 6 months ago
parent
commit
ab791d7cfa
2 changed files with 17 additions and 1 deletions
  1. 5 0
      README.md
  2. 12 1
      crawl_sse/options.py

+ 5 - 0
README.md

@@ -34,6 +34,11 @@ docker run -it --rm -v /data/crawl_sse:/app jianboy/crawl_sse:1.0.1 download --e
 分析年报:
 分析年报:
 docs/上市公司分析.ipynb
 docs/上市公司分析.ipynb
 
 
+
 ## License
 ## License
 
 
+Licensed under the [Apache 2.0](LICENSE) © [liuyuqi.gov@msn.cn](https://github.com/jianboy)
+
+
+
 ## Reference
 ## Reference

+ 12 - 1
crawl_sse/options.py

@@ -16,11 +16,22 @@ def parse_args():
     """
     """
     parse command line params
     parse command line params
     """
     """
-    parser = argparse.ArgumentParser(description='search domain')
+    parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, description='''
+            crawl_sse
+            command line params:
+            python main.py crawl --extractor cninfo
+            python main.py download --extractor cninfo
+            python main.py crawl --extractor sse
+                                     ''', epilog="Believe that with the above description, " +
+                                                            "you can start working right away. Wish you success")
+    # group = parser.add_mutually_exclusive_group()
     parser.add_argument('command',  help='command: crawl, download', choices=['crawl','download', 'help','version'] , default='help')
     parser.add_argument('command',  help='command: crawl, download', choices=['crawl','download', 'help','version'] , default='help')
     parser.add_argument('--extractor', help='extractor: cninfo, sse', choices=['cninfo','sse'], default='cninfo')
     parser.add_argument('--extractor', help='extractor: cninfo, sse', choices=['cninfo','sse'], default='cninfo')
     args = parser.parse_args()
     args = parser.parse_args()
 
 
+    if args is None:
+        parser.print_help()
+        sys.exit(1)
     # remove None
     # remove None
     command_line_conf = OrderedDict(
     command_line_conf = OrderedDict(
         {k: v for k, v in args.__dict__.items() if v is not None}
         {k: v for k, v in args.__dict__.items() if v is not None}