deason 2 年之前
父节点
当前提交
4e55d24e47
共有 2 个文件被更改,包括 11 次插入7 次删除
  1. 2 0
      exportexamdetail/examInf.py
  2. 9 7
      exportexamdetail/main.py

+ 2 - 0
exportexamdetail/examInf.py

@@ -68,6 +68,8 @@ def querydetail(curpage):
 
 
         if curpage < totalPages:
         if curpage < totalPages:
             querydetail(curpage + 1)
             querydetail(curpage + 1)
+    else:
+        raise Exception("获取数据失败,请检查配置参数或网络是否正常!")
 
 
 
 
 @calctime
 @calctime

+ 9 - 7
exportexamdetail/main.py

@@ -1,12 +1,14 @@
 import examInf
 import examInf
 
 
-def main():
-    # 访问res文件夹下a.txt的内容
-
-    examInf.querydetail(1)
-
 
 
+def main():
+    try:
+        examInf.querydetail(1)
+    except Exception as e:
+        print(e)
+    finally:
+        input("输入任意键退出!")
 
 
 
 
-if __name__=="__main__":
-    main()
+if __name__ == "__main__":
+    main()