提交 f8336d00 作者: XveLingKun

工具包

上级 3bc0ad9e
...@@ -15,6 +15,8 @@ cnx = baseCore.cnx ...@@ -15,6 +15,8 @@ cnx = baseCore.cnx
cursor = baseCore.cursor cursor = baseCore.cursor
db_storage = pymongo.MongoClient('mongodb://114.115.221.202:27017/', username='admin', password='ZZsn@9988').ZZSN[ db_storage = pymongo.MongoClient('mongodb://114.115.221.202:27017/', username='admin', password='ZZsn@9988').ZZSN[
'天眼查登录信息'] '天眼查登录信息']
db_storage2 = pymongo.MongoClient('mongodb://114.115.221.202:27017/', username='admin', password='ZZsn@9988').ZZSN[
'股东信息']
class File(): class File():
...@@ -58,7 +60,7 @@ class Token(): ...@@ -58,7 +60,7 @@ class Token():
# 获取token # 获取token
def get_cookies(self): def get_cookies(self):
flg = False flg = False
query = { "fenghaoTime": { "$lt": str(datetime.datetime.now() - datetime.timedelta(hours=2))}} query = {"fenghaoTime": {"$lt": str(datetime.datetime.now() - datetime.timedelta(hours=2))}}
result = db_storage.find_one(query, sort=[('updateTime', 1)]) result = db_storage.find_one(query, sort=[('updateTime', 1)])
# results = db_storage.find({}, sort=[('updateTime', 1)]) # results = db_storage.find({}, sort=[('updateTime', 1)])
if result: if result:
...@@ -104,7 +106,7 @@ class Token(): ...@@ -104,7 +106,7 @@ class Token():
# 执行更新操作 # 执行更新操作
db_storage.update_one(filter, update) db_storage.update_one(filter, update)
cnx.commit() # cnx.commit()
class Tag(): class Tag():
...@@ -153,6 +155,23 @@ class Tag(): ...@@ -153,6 +155,23 @@ class Tag():
span4.extract() span4.extract()
class Info():
# 添加字段
def update_holder(self, no, dic_info):
db_storage2.update_one({'序号': str(no)}, {'$set': {'最大持股名称': dic_info['最大持股名称'], '持股比例': dic_info['持股比例'], '企业标签': dic_info['企业标签']}})
pass
def update_info(self, no, dic_info):
db_storage2.update_one({'序号': str(no)}, {
'$set': {'股东企业信用代码': dic_info['股东企业信用代码'], '股东企业标签': dic_info['股东企业标签']}})
pass
if __name__ == '__main__': if __name__ == '__main__':
token = Token() # token = Token()
print(token.get_cookies()) # print(token.get_cookies())
info = Info()
no = '71'
dic_info = {}
dic_info['最大持股名称'] = '1'
dic_info['持股比例'] = '2'
dic_info['企业标签'] = '3'
info.update_holder(no,dic_info)
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论