|
@@ -42,7 +42,7 @@ class APIMgr():
|
|
|
GSTORE['headers'] = headers
|
|
|
|
|
|
#登录接口
|
|
|
- def mgr_login(self, phone='19937989931', password='123456',useproxies=False):
|
|
|
+ def mgr_login(self, phone='18211989987', password='123456',useproxies=False):
|
|
|
headers=GSTORE['headers']
|
|
|
self.s = requests.Session()
|
|
|
if useproxies:
|
|
@@ -78,7 +78,7 @@ class APIMgr():
|
|
|
headers = GSTORE['headers']
|
|
|
# 保存session
|
|
|
session = self.s
|
|
|
- response = session.post("https://www.jianyu360.cn/publicapply/enterpriseSearch/doQuery", headers=headers, data={
|
|
|
+ response = session.post(f"{cfg.target_host}/publicapply/enterpriseSearch/doQuery", headers=headers, data={
|
|
|
'match': match,
|
|
|
'matchType': matchType,
|
|
|
'pageSize': pageSize,
|
|
@@ -92,7 +92,7 @@ class APIMgr():
|
|
|
pageSize=50, pageIndex=1):
|
|
|
headers = GSTORE['headers']
|
|
|
headers['Content-Type'] = 'application/json' # 添加Content-Type头部
|
|
|
- url = "https://www.jianyu360.cn/jyinfo/supplySearch"
|
|
|
+ url = f"{cfg.target_host}/jyinfo/supplySearch"
|
|
|
data = {
|
|
|
"keywords": keywords,
|
|
|
"searchType": searchType,
|
|
@@ -103,7 +103,27 @@ class APIMgr():
|
|
|
"pageSize": pageSize,
|
|
|
"pageIndex": pageIndex
|
|
|
}
|
|
|
- response = requests.post(url=url, headers=headers, data=json.dumps(data))
|
|
|
+ session=self.s
|
|
|
+ response = session.post(url=url, headers=headers, data=json.dumps(data))
|
|
|
+ self.printResponse(response)
|
|
|
+ return response
|
|
|
+
|
|
|
+ #采购单位搜索
|
|
|
+ def buyersousuo(self, buyerName, province=[], city=[], buyerClass=[], isCheckFollow=True, isCheckReceive=True,
|
|
|
+ isContact=0, pageSize=10,pageNum=1):
|
|
|
+ url = f"{cfg.target_host}/jyapi/jybx/buyer/eType/buyerList"
|
|
|
+ data = {
|
|
|
+ "buyerName": buyerName,
|
|
|
+ "province": province,
|
|
|
+ "city": city,
|
|
|
+ "buyerClass": buyerClass,
|
|
|
+ "isCheckFollow": isCheckFollow,
|
|
|
+ "isCheckReceive": isCheckReceive,
|
|
|
+ "isContact": isContact,
|
|
|
+ "pageSize": pageSize,
|
|
|
+ "pageNum":pageNum
|
|
|
+ }
|
|
|
+ response = requests.post(url=url, data=json.dumps(data), headers=self.headers)
|
|
|
self.printResponse(response)
|
|
|
return response
|
|
|
|