Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
c04f26fb
提交
c04f26fb
authored
12月 20, 2023
作者:
薛凌堃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
企业年报脚本维护
上级
310e8f15
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
19 行增加
和
5 行删除
+19
-5
证监会-年报.py
comData/annualReport/证监会-年报.py
+14
-3
雪球网-年报.py
comData/annualReport/雪球网-年报.py
+5
-2
没有找到文件。
comData/annualReport/证监会-年报.py
浏览文件 @
c04f26fb
impor
t
json
impor
t
json
...
...
@@ -76,8 +76,19 @@ def SpiderByZJH(url, payload, dic_info, num, start_time):
soup
=
RequestUrl
(
url
,
payload
,
item_id
,
start_time
)
if
soup
==
''
:
return
# 先获取页数
# 判断查找内容是否存在
try
:
is_exist
=
soup
.
find
(
'div'
,
class_
=
'con'
)
.
text
if
is_exist
==
'没有查询到数据'
:
state
=
0
takeTime
=
baseCore
.
getTimeCost
(
start_time
,
time
.
time
())
baseCore
.
recordLog
(
social_code
,
taskType
,
state
,
takeTime
,
url
,
'没有查询到数据'
)
return
except
:
pass
# 先获取页数
page
=
soup
.
find
(
'div'
,
class_
=
'pages'
)
.
find
(
'ul'
,
class_
=
'g-ul'
)
.
text
total
=
re
.
findall
(
r'\d+'
,
page
)[
0
]
...
...
@@ -135,7 +146,7 @@ def SpiderByZJH(url, payload, dic_info, num, start_time):
year
=
str
(
year
)
# page_size = 0
name_pdf
=
f
'{short_name}
:
{year}年年度报告.pdf'
name_pdf
=
f
'{short_name}
:
{year}年年度报告.pdf'
sel_sql
=
'''select item_id,year from clb_sys_attachment where item_id =
%
s and year =
%
s and type_id=1'''
cursor_
.
execute
(
sel_sql
,
(
item_id
,
year
))
selects
=
cursor_
.
fetchone
()
...
...
comData/annualReport/雪球网-年报.py
浏览文件 @
c04f26fb
# -*-
coding: utf-8 -*-
# -*-
coding: utf-8 -*-
...
...
@@ -12,7 +12,7 @@ from datetime import datetime
from
kafka
import
KafkaProducer
import
sys
sys
.
path
.
append
(
'D:
\\
KK
\\
zzsn_spider
\\
base'
)
sys
.
path
.
append
(
'D:
\\
kkwork
\\
zzsn_spider
\\
base'
)
import
BaseCore
baseCore
=
BaseCore
.
BaseCore
()
import
requests
,
re
,
time
,
pymysql
,
fitz
...
...
@@ -79,6 +79,8 @@ def spider_annual_report(dict_info,num):
except
:
log
.
info
(
f
'{social_code}.........年度报告列表为空'
)
exception
=
'年度报告列表为空'
# 证监会企业年报
baseCore
.
r
.
rpush
(
'AnnualEnterprise:zjh_socialCode'
,
social_code
)
state
=
0
takeTime
=
baseCore
.
getTimeCost
(
start_time
,
time
.
time
())
baseCore
.
recordLog
(
social_code
,
taskType
,
state
,
takeTime
,
''
,
exception
)
...
...
@@ -310,6 +312,7 @@ if __name__ == '__main__':
count
+=
1
runType
=
'AnnualReportCount'
baseCore
.
updateRun
(
social_code
,
runType
,
count
)
baseCore
.
r
.
rpush
(
'AnnualEnterprise:zjh_socialCode'
,
social_code
)
# break
# cursor.close()
cnx_
.
close
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论