main.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. # This sample code uses the Appium python client v2
  2. # pip install Appium-Python-Client
  3. # Then you can paste this into a file and simply run with Python
  4. import random
  5. import types
  6. from typing import Union
  7. from appium import webdriver
  8. from selenium.common import TimeoutException
  9. from selenium.webdriver.support.ui import WebDriverWait
  10. from appium.webdriver.common.appiumby import AppiumBy
  11. from datetime import datetime
  12. import time
  13. import os
  14. import sys
  15. import getopt
  16. # import winsound
  17. # For W3C actions
  18. from selenium.webdriver.common.action_chains import ActionChains
  19. from selenium.webdriver.common.actions import interaction
  20. from selenium.webdriver.common.actions.action_builder import ActionBuilder
  21. from selenium.webdriver.common.actions.pointer_input import PointerInput
  22. from selenium.webdriver.support import expected_conditions
  23. isProfession = False
  24. driver = ''
  25. # 起始id
  26. startId = 10006
  27. # 结束id
  28. endId = 12900
  29. # ignores
  30. ignores = []
  31. # indicate, higher priority than start-end for no-seq targets
  32. targets = []
  33. card_id = "15700779"
  34. card_pwd = "244796"
  35. phone = '13974787400'
  36. phone_pwd = 'Xj654123'
  37. hide_guide = False
  38. stop = False
  39. retry_times_max = 1 # 搜索loading时,间隔几次重新点击搜索
  40. retry_current = 0 # 暂时没有用途了
  41. batch_count = 3 # 有几个批次
  42. subject_default_top = True # 默认理科、物理
  43. plan_change_years = [2,3] # 计划取几年?从 1 开始
  44. profession_change_years = [1] # 专业取几年?从 1 开始
  45. # 登录方式 1 卡号 2 手机密码
  46. loginType = 1
  47. # 数据类型 1 招生计划 2 历年录取 3 两者都有
  48. dataType = 2
  49. def randomSleep():
  50. rd = random.choice([0, 0.5, 0.8, 0.75, 1, 2, 1.5, 1.2, 1.8])
  51. if rd: time.sleep(rd / 4.0)
  52. def init():
  53. global driver
  54. global isProfession
  55. print('程序启动')
  56. caps = {}
  57. caps["platformName"] = "Android"
  58. caps["appium:platformVersion"] = "6.0"
  59. caps["appium:deviceName"] = "emulator-5554"
  60. caps["appium:appPackage"] = "com.eagersoft.youzy.youzy"
  61. # .mvvm.ui.login.LoginAndRegisterSelectActivity
  62. # .mvvm.ui.college.FindCollegeActivity
  63. caps["appium:appActivity"] = ".mvvm.ui.login.LoginAndRegisterSelectActivity"
  64. caps["appium:resetKeyboard"] = True
  65. caps["appium:ensureWebviewsHavePages"] = True
  66. caps["appium:nativeWebScreenshot"] = True
  67. caps["appium:newCommandTimeout"] = 3600
  68. caps["appium:connectHardwareKeyboard"] = True
  69. driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", caps)
  70. # 不要混合使用隐式和显式等待。这样做会导致不可预测的等待时间。例如,将隐式等待设置为10秒,将显式等待设置为15秒, 可能会导致在20秒后发生超时。
  71. # driver.implicitly_wait(2)
  72. def start():
  73. init()
  74. login()
  75. def alarm():
  76. if sys.platform.startswith('win'):
  77. pass # winsound.Beep(1000, 3000)
  78. elif sys.platform.startswith('darwin'):
  79. os.system("say --voice=\"Mei-Jia\" 出错了,请尽快处理")
  80. def getForkRange():
  81. if targets:
  82. return targets
  83. else:
  84. return range(startId, endId + 1)
  85. def login():
  86. if loginType == 1:
  87. login_by_card()
  88. elif loginType == 2:
  89. login_by_phone()
  90. else:
  91. login_by_card()
  92. def login_success():
  93. # 弹出了验证窗口,请在20s内通过验证
  94. entrance_xpath = "/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/" \
  95. "android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/" \
  96. "android.widget.FrameLayout/android.view.ViewGroup/androidx.viewpager.widget.ViewPager/" \
  97. "android.view.ViewGroup/android.widget.LinearLayout/android.widget.FrameLayout/" \
  98. "android.view.ViewGroup[1]/android.view.ViewGroup/android.view.ViewGroup[2]/" \
  99. "androidx.viewpager.widget.ViewPager/androidx.recyclerview.widget.RecyclerView/" \
  100. "android.view.ViewGroup[1]"
  101. modal_id = "com.eagersoft.youzy.youzy:id/click_close_dialog_activity_pop"
  102. try:
  103. def load(x):
  104. modal = find_ele_by_id(modal_id)
  105. if modal is not None:
  106. modal.click()
  107. return True
  108. else:
  109. if find_ele_by_xpath(entrance_xpath) is not None:
  110. return True
  111. else:
  112. return False
  113. return False
  114. except:
  115. print('超时了')
  116. sys.exit()
  117. alarm()
  118. WebDriverWait(driver, 120).until(load)
  119. # 登录成功并且关闭了弹窗
  120. try:
  121. # 进入学校列表
  122. entrance = find_ele_by_xpath(entrance_xpath)
  123. entrance.click()
  124. # 开始工作
  125. global_begin_time = time.time()
  126. college_range = getForkRange()
  127. for i in college_range:
  128. if i in ignores: continue
  129. current_no = college_range.index(i) + 1
  130. time_diff = time.time() - global_begin_time
  131. print('进度统计:', current_no, 'OF', len(college_range), 'IN', time_diff / 3600, 'Hours')
  132. if not stop:
  133. auto_click(i)
  134. else:
  135. print('结束')
  136. return
  137. time_diff = time.time() - global_begin_time
  138. current_speed1 = time_diff / current_no
  139. current_speed2 = current_no * 3600 / time_diff
  140. print('速率统计:', current_speed1, 'Seconds of Each.', current_speed2, 'Completed Per Hour.')
  141. # auto_click(startId)
  142. except Exception as e:
  143. print('错误:', repr(e))
  144. def login_by_card():
  145. el1 = find_ele_by_id("com.eagersoft.youzy.youzy:id/click_login_register_card")
  146. el1.click()
  147. el3 = find_ele_by_id("com.eagersoft.youzy.youzy:id/cardNumber")
  148. el3.send_keys(card_id)
  149. el4 = find_ele_by_id("com.eagersoft.youzy.youzy:id/password")
  150. el4.send_keys(card_pwd)
  151. el5 = find_ele_by_id("com.eagersoft.youzy.youzy:id/checkbox")
  152. el5.click()
  153. el6 = find_ele_by_id("com.eagersoft.youzy.youzy:id/click_next")
  154. el6.click()
  155. login_success()
  156. def login_by_phone():
  157. el2 = driver.find_element(by=AppiumBy.ID, value="com.eagersoft.youzy.youzy:id/click_login_register_mobile")
  158. el2.click()
  159. time.sleep(1)
  160. el3 = driver.find_element(by=AppiumBy.ID, value="com.eagersoft.youzy.youzy:id/click_login_by_password")
  161. el3.click()
  162. time.sleep(0.5)
  163. el4 = driver.find_element(by=AppiumBy.ID, value="com.eagersoft.youzy.youzy:id/account")
  164. el4.send_keys(phone)
  165. time.sleep(1)
  166. el5 = driver.find_element(by=AppiumBy.ID, value="com.eagersoft.youzy.youzy:id/password")
  167. el5.send_keys(phone_pwd)
  168. time.sleep(1)
  169. el6 = driver.find_element(by=AppiumBy.ID, value="com.eagersoft.youzy.youzy:id/checkbox")
  170. el6.click()
  171. time.sleep(1)
  172. el7 = driver.find_element(by=AppiumBy.ID, value="com.eagersoft.youzy.youzy:id/click_login_register_mobile")
  173. el7.click()
  174. time.sleep(1)
  175. login_success()
  176. def change_tab(tabIndex=1) -> bool:
  177. print('切换tab')
  178. # 540 740 1213
  179. # 招生计划
  180. el_plan = find_ele_by_xpath(
  181. "/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/"
  182. "android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/"
  183. "android.widget.RelativeLayout/android.view.ViewGroup/android.view.ViewGroup[1]/"
  184. "android.widget.LinearLayout/android.widget.HorizontalScrollView/"
  185. "android.widget.LinearLayout/androidx.appcompat.app.ActionBar.Tab/"
  186. "android.view.ViewGroup/android.widget.TextView[contains(@text,'招生计划')]", 5)
  187. # print(el_plan)
  188. print(el_plan)
  189. change_success = False
  190. if tabIndex == 1:
  191. if el_plan is not None:
  192. el_plan.click()
  193. change_success = True
  194. elif tabIndex == 2:
  195. try:
  196. # 历年录取
  197. el_enter = find_ele_by_xpath(
  198. "/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/"
  199. "android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/"
  200. "android.widget.RelativeLayout/android.view.ViewGroup/android.view.ViewGroup[1]/"
  201. "android.widget.LinearLayout/android.widget.HorizontalScrollView/"
  202. "android.widget.LinearLayout/androidx.appcompat.app.ActionBar.Tab/android.view.ViewGroup/"
  203. "android.widget.TextView[contains(@text,'历年录取')]", 5)
  204. # print(el_enter)
  205. if el_enter is not None:
  206. el_enter.click()
  207. change_success = True
  208. except:
  209. if el_plan is not None:
  210. el_plan.click()
  211. # 历年录取
  212. # time.sleep(1) # tab会横向滑动,稍等会
  213. el_enter = find_ele_by_xpath(
  214. "/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/"
  215. "android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/"
  216. "android.widget.RelativeLayout/android.view.ViewGroup/android.view.ViewGroup[1]/"
  217. "android.widget.LinearLayout/android.widget.HorizontalScrollView/"
  218. "android.widget.LinearLayout/androidx.appcompat.app.ActionBar.Tab/android.view.ViewGroup/"
  219. "android.widget.TextView[contains(@text,'历年录取')]")
  220. # print(el_enter)
  221. if el_enter is not None:
  222. el_enter.click()
  223. change_success = True
  224. else:
  225. if el_plan is not None:
  226. el_plan.click()
  227. change_success = True
  228. return change_success
  229. def change_time(count: int = 2):
  230. print('切换年份')
  231. tv_year = find_ele_by_id("com.eagersoft.youzy.youzy:id/tv_year")
  232. tv_year.click()
  233. el_year = find_ele_by_xpath(f"/hierarchy/android.widget.FrameLayout/android.widget"
  234. f".LinearLayout/android.widget.FrameLayout/android.widget"
  235. f".FrameLayout/android.widget.FrameLayout/android.widget"
  236. f".FrameLayout/android.view.ViewGroup/android.widget"
  237. f".FrameLayout/android.view.ViewGroup/android.view."
  238. f"ViewGroup/android.widget.ScrollView/android.widget"
  239. f".LinearLayout/android.view.ViewGroup/android.widget"
  240. f".LinearLayout/androidx.recyclerview.widget"
  241. f".RecyclerView/android.view.ViewGroup[{count}]/android.widget.TextView")
  242. el_year.click()
  243. def open_profession():
  244. print('切换专业分数线')
  245. el_switch = find_ele_by_xpath(
  246. "/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/"
  247. "android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/"
  248. "android.widget.RelativeLayout/android.view.ViewGroup/android.view.ViewGroup[1]/"
  249. "androidx.viewpager.widget.ViewPager/android.view.ViewGroup/android.widget.ScrollView/"
  250. "android.view.ViewGroup/android.widget.LinearLayout/android.view.View")
  251. el_switch_mid_x = el_switch.location['x'] + el_switch.size['width'] / 2
  252. el_switch_mid_y = el_switch.location['y'] + el_switch.size['height'] / 2
  253. print(el_switch, el_switch_mid_x, el_switch_mid_y)
  254. actions = ActionChains(driver)
  255. actions.w3c_actions = ActionBuilder(driver, mouse=PointerInput(interaction.POINTER_TOUCH, "touch"))
  256. actions.w3c_actions.pointer_action.move_to_location(el_switch_mid_x, el_switch_mid_y)
  257. actions.w3c_actions.pointer_action.pointer_down()
  258. actions.w3c_actions.pointer_action.pause(0.1)
  259. actions.w3c_actions.pointer_action.release()
  260. actions.perform()
  261. def change_batch(count):
  262. # 3个科目都点击一次
  263. print('打开批次面板', count)
  264. for index in range(count):
  265. # el_dropdown = find_ele_by_id("com.eagersoft.youzy.youzy:id/ll_select_college_batch")
  266. el_dropdown = WebDriverWait(driver, 5, 0.5).until(expected_conditions.presence_of_element_located(
  267. (AppiumBy.ID, "com.eagersoft.youzy.youzy:id/ll_select_college_batch")))
  268. if el_dropdown is not None:
  269. el_dropdown.click()
  270. else:
  271. # 表示元素有,但不可见,需要滚动至可见
  272. driver.execute_script("arguments[0].scrollIntoView();", el_dropdown)
  273. el_dropdown.click()
  274. batch_item_path = f"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget" \
  275. f".FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget" \
  276. f".FrameLayout/android.view.ViewGroup/android.widget.FrameLayout/android.view" \
  277. f".ViewGroup/android.view.ViewGroup/android.widget.ScrollView/android.widget" \
  278. f".LinearLayout/android.view.ViewGroup/android.widget.LinearLayout/androidx" \
  279. f".recyclerview.widget.RecyclerView/android.view.ViewGroup[{index + 1}]"
  280. try:
  281. el_batch_item = find_ele_by_xpath(batch_item_path)
  282. el_batch_item.click()
  283. except Exception as ex:
  284. print('切换批次异常,索引', index, '乎略异常', ex)
  285. el_ddl_close = find_ele_by_id('com.eagersoft.youzy.youzy:id/iv_close')
  286. el_ddl_close.click()
  287. randomSleep()
  288. def cicle():
  289. change_batch(batch_count)
  290. # time.sleep(0.5)
  291. # 切换科目
  292. subtype_tab = find_ele_by_id("com.eagersoft.youzy.youzy:id/tv_subject_type")
  293. if subtype_tab is not None:
  294. subtype_tab.click()
  295. # time.sleep(0.5)
  296. subject_index = 1
  297. if subject_default_top: subject_index = 2
  298. subject_path = f"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget" \
  299. f".FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget" \
  300. f".FrameLayout/android.view.ViewGroup/android.widget.FrameLayout/android.view.ViewGroup/android" \
  301. f".view.ViewGroup/android.widget.ScrollView/android.widget.LinearLayout/android.view" \
  302. f".ViewGroup/android.widget.LinearLayout/androidx.recyclerview.widget.RecyclerView/android" \
  303. f".view.ViewGroup[{subject_index}]"
  304. el29 = find_ele_by_xpath(subject_path)
  305. if el29 is not None:
  306. el29.click()
  307. # time.sleep(0.5)
  308. change_batch(batch_count - 1)
  309. # time.sleep(0.5)
  310. def get_data(tab_index, change_years):
  311. if change_tab(tab_index):
  312. # time.sleep(1)
  313. if tab_index == 2:
  314. open_profession()
  315. # time.sleep(1)
  316. if change_years[0] == 1: # 如果第 1 个是默认年份,直接开始批次切换
  317. cicle()
  318. for year in change_years:
  319. if year == 1:
  320. cicle()
  321. else:
  322. # 从第二个年份开始切换
  323. change_time(year)
  324. cicle()
  325. else:
  326. raise Exception("切换tab失败")
  327. def is_error() -> bool:
  328. try:
  329. return (WebDriverWait(driver, 0.5, 0.25).until(expected_conditions.visibility_of_element_located(
  330. (AppiumBy.ID, "com.eagersoft.youzy.youzy:id/errorViewRelativeLayout"))) or
  331. WebDriverWait(driver, 0.5, 0.25).until(
  332. expected_conditions.visibility_of_element_located(
  333. (AppiumBy.ID, "com.eagersoft.youzy.youzy:id/load_more_load_fail_view"))))
  334. except:
  335. return False
  336. def retry():
  337. try:
  338. retry_button = WebDriverWait(driver, 2, 0.5).until(
  339. expected_conditions.visibility_of_element_located(
  340. (AppiumBy.ID, "com.eagersoft.youzy.youzy:id/errorStateButton")))
  341. if retry_button is not None:
  342. retry_button.click()
  343. else:
  344. retry_button = WebDriverWait(driver, 2, 0.5).until(
  345. expected_conditions.visibility_of_element_located(
  346. (AppiumBy.ID, "com.eagersoft.youzy.youzy:id/tv_prompt")))
  347. if retry_button is not None:
  348. retry_button.click()
  349. except Exception as ex:
  350. print('retry ignored', ex)
  351. def is_loading() -> bool:
  352. try:
  353. return (WebDriverWait(driver, 0.5, 0.25).until(expected_conditions.visibility_of_element_located(
  354. (AppiumBy.ID, "com.eagersoft.youzy.youzy:id/image_loading"))) or
  355. WebDriverWait(driver, 0.5, 0.25).until(expected_conditions.visibility_of_element_located(
  356. (AppiumBy.ID, "com.eagersoft.youzy.youzy:id/load_more_load_end_view"))))
  357. except:
  358. return False
  359. def find_ele_by_id(ele_id: str, timeout: int = 2, poll_frequency: int = 0.5, deep: int = 0):
  360. loading = False
  361. error = False
  362. try:
  363. def find(x):
  364. nonlocal loading
  365. nonlocal error
  366. if is_error():
  367. print("error by id", x)
  368. error = True
  369. loading = False
  370. return False
  371. if is_loading():
  372. print("loading")
  373. loading = True
  374. error = False
  375. return False
  376. return x.find_element(by=AppiumBy.ID, value=ele_id) is not None
  377. WebDriverWait(driver, timeout, poll_frequency).until(find)
  378. return driver.find_element(by=AppiumBy.ID, value=ele_id)
  379. except:
  380. if loading:
  381. print("新一轮loading", deep)
  382. if retry_times_max > 0 and deep > 0 and deep % retry_times_max == 0:
  383. try:
  384. print('重新触发查询', deep, '%', retry_times_max)
  385. btn_search = driver.find_element(by=AppiumBy.ID, value="com.eagersoft.youzy.youzy:id/tv_search")
  386. btn_search.click()
  387. except Exception as e:
  388. print('重新触发查询 except', e)
  389. return find_ele_by_id(ele_id, timeout, poll_frequency, deep + 1)
  390. elif error:
  391. print("error,重试")
  392. retry()
  393. return find_ele_by_id(ele_id, timeout * 2, poll_frequency, deep + 1)
  394. else:
  395. return None
  396. def find_ele_by_xpath(ele_xpath: str, timeout: int = 2, poll_frequency: int = 0.5):
  397. loading = False
  398. error = False
  399. try:
  400. def find(x):
  401. nonlocal loading
  402. nonlocal error
  403. if is_error():
  404. print("error by path", x)
  405. error = True
  406. loading = False
  407. return False
  408. if is_loading():
  409. print("loading")
  410. loading = True
  411. error = False
  412. return False
  413. return x.find_element(by=AppiumBy.XPATH, value=ele_xpath)
  414. return WebDriverWait(driver, timeout, poll_frequency).until(find)
  415. except:
  416. if loading:
  417. print("新一轮,loading")
  418. return find_ele_by_xpath(ele_xpath, timeout, poll_frequency)
  419. elif error:
  420. print("新一轮,重试")
  421. retry()
  422. return find_ele_by_xpath(ele_xpath, timeout, poll_frequency)
  423. else:
  424. return None
  425. def find_college(college_id: Union[str, int]) -> Union[bool, 'WebElement']:
  426. el23 = find_ele_by_id("com.eagersoft.youzy.youzy:id/et_input")
  427. el23.send_keys(college_id)
  428. el24 = find_ele_by_id("com.eagersoft.youzy.youzy:id/tv_search")
  429. el24.click()
  430. empty_container = find_ele_by_id("com.eagersoft.youzy.youzy:id/emptyViewRelativeLayout", timeout=2)
  431. if empty_container is not None:
  432. return False
  433. else:
  434. college = find_ele_by_id("com.eagersoft.youzy.youzy:id/cl_parent")
  435. if college is not None:
  436. return college
  437. return False
  438. def back():
  439. el_back = find_ele_by_id("com.eagersoft.youzy.youzy:id/iv_back")
  440. if el_back is not None:
  441. print("返回页面")
  442. el_back.click()
  443. def auto_click(id):
  444. global hide_guide
  445. global stop
  446. global retry_current
  447. global dataType
  448. global loginType
  449. print('当前id:', id, datetime.now())
  450. # 开始搜索
  451. el_search = find_ele_by_id("com.eagersoft.youzy.youzy:id/click_search")
  452. if el_search is not None:
  453. el_search.click()
  454. college = find_college(id)
  455. if isinstance(college, bool):
  456. return
  457. else:
  458. college.click()
  459. retry_current = 0
  460. try:
  461. if not hide_guide:
  462. print('等待关闭引导')
  463. time.sleep(6)
  464. # actions = ActionChains(driver)
  465. # actions.w3c_actions = ActionBuilder(driver, mouse=PointerInput(interaction.POINTER_TOUCH, "touch"))
  466. # actions.w3c_actions.pointer_action.move_to_location(507, 1537)
  467. # actions.w3c_actions.pointer_action.pointer_down()
  468. # actions.w3c_actions.pointer_action.pause(0.1)
  469. # actions.w3c_actions.pointer_action.release()
  470. # actions.perform()
  471. hide_guide = True
  472. # time.sleep(1)
  473. if dataType == 1:
  474. get_data(1, plan_change_years)
  475. elif dataType == 2:
  476. get_data(2, profession_change_years)
  477. elif dataType == 3:
  478. get_data(1, plan_change_years)
  479. get_data(2, profession_change_years)
  480. # 回退两次,清除学校列表缓存
  481. back()
  482. back()
  483. except Exception as ex:
  484. print('get_data exception', ex)
  485. alarm()
  486. back()
  487. back()
  488. auto_click(id)
  489. if __name__ == '__main__':
  490. try:
  491. args = sys.argv[1:]
  492. longopts = ['loginType=', 'dataType=']
  493. shortopts = []
  494. options, args = getopt.getopt(args, shortopts, longopts)
  495. for name, value in options:
  496. print(name, value)
  497. if name in ('--loginType'):
  498. loginType = int(value)
  499. if name in '--dataType':
  500. dataType = int(value)
  501. except:
  502. print('运行参数解析错误')
  503. if dataType == 1:
  504. print('招生计划')
  505. elif dataType == 2:
  506. print('历年录取')
  507. else:
  508. print('招生计划和历年录取')
  509. start()