第三方均价输出
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from pymongo import MongoClient
|
||||
def getMongo(*args):
|
||||
if len(args) == 6:
|
||||
con = MongoClient(args[0], args[1]) # 获取链接\
|
||||
db_auth = con.fangjia_craw
|
||||
if args[2] =="vip_site":
|
||||
db_auth.authenticate(args[4], args[5],"fangjia_craw")
|
||||
else:
|
||||
db_auth.authenticate(args[4], args[5],"admin")
|
||||
db = con[args[2]] # 关联数据库
|
||||
collection = db[args[3]] # 关联数据表
|
||||
elif len(args) == 4:
|
||||
con = MongoClient(args[0], args[1]) # 获取链接
|
||||
db = con[args[2]] # 关联数据库
|
||||
collection = db[args[3]] # 关联数据表
|
||||
return collection
|
||||
#线上小区库
|
||||
seaweed_on = getMongo("192.168.0.43",28017,"fangjia","seaweed","developer","G00IDCDEV12385")
|
||||
sz_price_on = getMongo("192.168.0.43",28017,"fangjia","sz_price","developer","G00IDCDEV12385")
|
||||
district_stat_on = getMongo("192.168.0.43",28017,"fangjia_stat","district_stat","developer","G00IDCDEV12385")
|
||||
seaweed_map = getMongo("192.168.0.235",27018,"fangjia","seaweedmap")
|
||||
web_community_check = getMongo("192.168.0.235",27018,"fangjia","web_community_check")
|
||||
web_invalid_comm = getMongo("192.168.0.235",27018,"fangjia","web_invalid_comm")
|
||||
addr_nine_level = getMongo("192.168.0.206",27020,"etl","nine_level")
|
||||
gxd_price = getMongo("192.168.0.43",28017,"fangjia","confirm_price_data","developer","G00IDCDEV12385")
|
||||
Reference in New Issue
Block a user