|
@@ -66,17 +66,14 @@ class APIMgr():
|
|
|
s.post(url=url, headers=headers)
|
|
|
# self.printResponse(res)
|
|
|
# return res
|
|
|
-
|
|
|
- def purchasesearch(self, keywords="建筑", publishtime="fiveyear", selectType="content"):
|
|
|
+ #招标搜索
|
|
|
+ def bidsearch(self, keywords="建筑", publishtime="fiveyear", selectType="content"):
|
|
|
#使用全局变量
|
|
|
headers = GSTORE['headers']
|
|
|
+ params={"keywords":keywords,"publishtime":publishtime,"timeslot":"","area":"","subtype":"","minprice":"","maxprice":"","industry":"","buyerclass":"","buyertel":"","winnertel":"","selectType":selectType,"notkey":"","fileExists":"0","city":"","searchGroup":"0","searchMode":"0","wordsMode":"0","additionalWords":""}
|
|
|
#保存session
|
|
|
session = self.s
|
|
|
- response = session.post(f"{cfg.target_host}/jylab/supsearch/index.html", headers=headers, data={
|
|
|
- 'keywords': keywords,
|
|
|
- 'publishtime': publishtime,
|
|
|
- 'selectType': selectType
|
|
|
- })
|
|
|
+ response = session.post(f"{cfg.target_host}/jylab/supsearch/index.html", headers=headers, params=params)
|
|
|
self.printResponse(response)
|
|
|
return response
|
|
|
|
|
@@ -134,7 +131,7 @@ class APIMgr():
|
|
|
response = requests.post(url=url, json=data, headers=self.headers)
|
|
|
self.printResponse(response)
|
|
|
return response
|
|
|
-
|
|
|
+ #接口数据传值常用三种方式:urlencoded---params,键值对---data,json格式---json
|
|
|
#获取推送记录接口
|
|
|
def push_list(self):
|
|
|
headers=GSTORE['headers']
|