mirror of https://github.com/testerSunshine/12306
fix
parent
632a971606
commit
01d54be85a
|
@ -2,3 +2,4 @@
|
||||||
*.pyc
|
*.pyc
|
||||||
*.yaml
|
*.yaml
|
||||||
*.log
|
*.log
|
||||||
|
idea/
|
||||||
|
|
|
@ -43,10 +43,19 @@ set:
|
||||||
station_dates:
|
station_dates:
|
||||||
# - "2018-01-27"
|
# - "2018-01-27"
|
||||||
# - "2018-01-28"
|
# - "2018-01-28"
|
||||||
- "2018-02-10"
|
|
||||||
- "2018-02-09"
|
- "2018-02-09"
|
||||||
|
- "2018-02-10"
|
||||||
|
# - "2018-02-09"
|
||||||
station_trains:
|
station_trains:
|
||||||
|
- "G4741"
|
||||||
- "G2365"
|
- "G2365"
|
||||||
|
- "G1371"
|
||||||
|
- "G1337"
|
||||||
|
- "G1377"
|
||||||
|
- "G1329"
|
||||||
|
# - "G1302"
|
||||||
|
# - "G1372"
|
||||||
|
# - "G1326"
|
||||||
# - "K4300"
|
# - "K4300"
|
||||||
# - "K5226"
|
# - "K5226"
|
||||||
# - "K7772"
|
# - "K7772"
|
||||||
|
|
|
@ -186,7 +186,7 @@ class select:
|
||||||
def submitOrderRequestFunc(self, from_station, to_station, station_date=None):
|
def submitOrderRequestFunc(self, from_station, to_station, station_date=None):
|
||||||
select_url = self.confUrl["select_url"]["req_url"].format(
|
select_url = self.confUrl["select_url"]["req_url"].format(
|
||||||
station_date, from_station, to_station)
|
station_date, from_station, to_station)
|
||||||
station_ticket = self.httpClint.send(select_url)
|
station_ticket = self.httpClint.send(select_url, is_logger=False)
|
||||||
return json.loads(station_ticket)
|
return json.loads(station_ticket)
|
||||||
|
|
||||||
def submitOrderRequestImplement(self, from_station, to_station,):
|
def submitOrderRequestImplement(self, from_station, to_station,):
|
||||||
|
@ -538,7 +538,7 @@ class select:
|
||||||
elif "messages" in queryOrderWaitTimeResult and queryOrderWaitTimeResult["messages"]:
|
elif "messages" in queryOrderWaitTimeResult and queryOrderWaitTimeResult["messages"]:
|
||||||
print("排队等待失败: " + queryOrderWaitTimeResult["messages"])
|
print("排队等待失败: " + queryOrderWaitTimeResult["messages"])
|
||||||
else:
|
else:
|
||||||
print("第{}次排队中,请耐心等待".format(num))
|
print("第{}次排队中,请耐心等待".format(num+1))
|
||||||
else:
|
else:
|
||||||
print("排队中")
|
print("排队中")
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
|
@ -88,8 +88,9 @@ class HTTPClient(object):
|
||||||
else:
|
else:
|
||||||
method = "get"
|
method = "get"
|
||||||
self.resetHeaders()
|
self.resetHeaders()
|
||||||
logger.log(
|
if is_logger:
|
||||||
u"url: {0}\n入参: {1}\n请求方式: {2}\n".format(url,data,method,))
|
logger.log(
|
||||||
|
u"url: {0}\n入参: {1}\n请求方式: {2}\n".format(url,data,method,))
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
try:
|
try:
|
||||||
response = self._s.request(method=method,
|
response = self._s.request(method=method,
|
||||||
|
|
Loading…
Reference in New Issue