Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
119a9a33
提交
119a9a33
authored
11月 24, 2023
作者:
薛凌堃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
11/24
上级
c0b05e59
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
21 行增加
和
17 行删除
+21
-17
baseinfo1113.py
comData/BaseInfo_qcc/baseinfo1113.py
+7
-6
baseinfo1122.py
comData/BaseInfo_qcc/baseinfo1122.py
+0
-0
东方财富网-公告.py
comData/noticeReport/东方财富网-公告.py
+14
-11
东方财富网-港股公告.py
comData/noticeReport/东方财富网-港股公告.py
+0
-0
没有找到文件。
comData/BaseInfo_qcc/baseinfo1113.py
浏览文件 @
119a9a33
...
...
@@ -540,19 +540,20 @@ if __name__ == '__main__':
while
True
:
nowtime
=
baseCore
.
getNowTime
(
1
)
.
replace
(
'-'
,
''
)[:
8
]
file_name
=
f
'./data/国内企业基本信息采集情况
_{nowtime}
.xlsx'
file_name
=
f
'./data/国内企业基本信息采集情况.xlsx'
file
.
createFile
(
file_name
)
cookieinfo
=
token
.
getToken
()
id_cookie
=
cookieinfo
[
0
]
cookie_
=
json
.
loads
(
cookieinfo
[
1
])
# print(type(cookies))
if
cookie_
:
if
cookieinfo
:
pass
else
:
log
.
info
(
'==========已无cookies=========='
)
time
.
sleep
(
30
)
continue
id_cookie
=
cookieinfo
[
0
]
cookie_
=
json
.
loads
(
cookieinfo
[
1
])
# print(type(cookies))
# cookie_ = json.loads(cookies)
# print(type(cookie_))
log
.
info
(
f
"获取cookie到----{cookie_}"
)
...
...
@@ -621,7 +622,7 @@ if __name__ == '__main__':
# exchange = ''
count
=
redaytowork
(
com_name
,
social_code
,
securitiesCode
,
securitiesShortName
,
listingDate
,
category
,
exchange
,
ynDomestic
,
countryName
,
file_name
)
time
.
sleep
(
40
)
time
.
sleep
(
2
)
# break
# baseCore.r.close()
# baseCore.sendEmail(file_name)
...
...
comData/BaseInfo_qcc/baseinfo1122.py
0 → 100644
浏览文件 @
119a9a33
差异被折叠。
点击展开。
comData/noticeReport/东方财富网-公告.py
浏览文件 @
119a9a33
impor
t
os
impor
t
os
...
...
@@ -90,8 +90,8 @@ def getOBSres(pathType,name, response):
return
result
def
secrchATT
(
item_id
,
retData
,
type_id
):
sel_sql
=
f
"select id from clb_sys_attachment where item_id = '{item_id}' and path = '{retData['path']}' and type_id={type_id} "
cursor_
.
execute
(
sel_sql
)
sel_sql
=
'''select id from clb_sys_attachment where item_id =
%
s and path =
%
s and type_id=
%
s '''
cursor_
.
execute
(
sel_sql
,
(
item_id
,
retData
[
'path'
],
type_id
)
)
selects
=
cursor_
.
fetchone
()
return
selects
...
...
@@ -129,7 +129,7 @@ def tableUpdate(retData, com_name, year, pdf_name, num):
print
(
e
)
log
.
info
(
f
"更新完成:{item_id}===={pdf_name+category}"
)
try
:
selects
=
secrchATT
(
item_id
,
pdf_name
,
type_id
)
selects
=
secrchATT
(
item_id
,
retData
,
type_id
)
except
Exception
as
e
:
log
.
info
(
e
)
id
=
selects
[
0
]
...
...
@@ -217,8 +217,8 @@ def GetContent(pdf_url,info_url, pdf_name, social_code, year, pub_time, start_ti
# print(dic_news)
# 将相应字段通过kafka传输保存
try
:
producer
=
KafkaProducer
(
bootstrap_servers
=
[
'114.115.159.144:9092'
])
kafka_result
=
producer
.
send
(
"researchReportTopic
aaaas
"
,
producer
=
KafkaProducer
(
bootstrap_servers
=
[
'114.115.159.144:9092'
]
,
max_request_size
=
1024
*
1024
*
20
)
kafka_result
=
producer
.
send
(
"researchReportTopic"
,
json
.
dumps
(
dic_news
,
ensure_ascii
=
False
)
.
encode
(
'utf8'
))
print
(
kafka_result
.
get
(
timeout
=
10
))
...
...
@@ -342,7 +342,7 @@ def gonggao_info(dic_info):
baseCore
.
recordLog
(
social_code
,
taskType
,
state
,
takeTime
,
pdf_url
,
'成功'
)
# 发送kafka成功之后 再插入数据库
insert
=
InsterInto
(
social_code
,
pdf
_url
,
info_date
,
title
)
insert
=
InsterInto
(
social_code
,
info
_url
,
info_date
,
title
)
if
insert
:
log
.
info
(
f
'===={social_code}========{title}=====插入库成功'
)
pass
...
...
@@ -362,8 +362,8 @@ if __name__ =='__main__':
while
True
:
start_time
=
time
.
time
()
# 获取企业信息
# social_code = baseCore.redicPullData('NoticeEnterpriseEasteFinance:gnshqy_socialCode
')
social_code
=
'ZZSN23030900000316'
social_code
=
baseCore
.
redicPullData
(
'NoticeEnterprise:mgqy_socialCode_add
'
)
#
social_code = 'ZZSN23030900000316'
if
not
social_code
:
time
.
sleep
(
20
)
continue
...
...
@@ -378,8 +378,11 @@ if __name__ =='__main__':
code
=
dic_info
[
3
]
com_name
=
dic_info
[
1
]
log
.
info
(
f
'-----开始处理{com_name}----{social_code}------'
)
gonggao_info
(
dic_info
)
break
try
:
gonggao_info
(
dic_info
)
except
:
log
.
info
(
f
'-----error:{com_name}----{social_code}------'
)
comData/noticeReport/东方财富网-港股公告.py
0 → 100644
浏览文件 @
119a9a33
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论