Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
5fcdf451
提交
5fcdf451
authored
4月 28, 2024
作者:
XveLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
东方财富网指标中英对比调整 完成
上级
71156c0a
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
60 行增加
和
23 行删除
+60
-23
东方财富网财务数据.py
comData/caiwushuju/东方财富网财务数据.py
+60
-23
没有找到文件。
comData/caiwushuju/东方财富网财务数据.py
浏览文件 @
5fcdf451
"""
"""
...
...
@@ -158,13 +158,17 @@ def get_info(social_code, com_code,info_date,delist_all,info_date_list,taskType)
for
one_info
in
soup_zcfzb
.
find_all
(
'tr'
)[
2
:]:
if
'value.'
not
in
one_info
.
text
:
continue
# todo:24-4-12 添加判断标签是否是隐藏标签,是则跳过,找下一个标签
# todo:24-4-12 添加判断标签是否是隐藏标签,是则跳过,找下一个标签
info_tag_list
=
one_info
.
find_all
(
'span'
)
info_name
=
''
for
info_tag
in
info_tag_list
:
if
'display:none'
in
info_tag
.
get
(
'style'
):
continue
else
:
try
:
if
'display:none'
in
info_tag
.
get
(
'style'
):
continue
else
:
info_name
=
info_tag
.
text
break
except
:
info_name
=
info_tag
.
text
break
if
info_name
:
...
...
@@ -198,7 +202,24 @@ def get_info(social_code, com_code,info_date,delist_all,info_date_list,taskType)
for
one_info
in
soup_lrb
.
find_all
(
'tr'
)[
2
:]:
if
'value.'
not
in
one_info
.
text
:
continue
info_name
=
one_info
.
find
(
'span'
)
.
text
# todo:24-4-12 添加判断标签是否是隐藏标签,是则跳过,找下一个标签
info_tag_list
=
one_info
.
find_all
(
'span'
)
info_name
=
''
for
info_tag
in
info_tag_list
:
try
:
if
'display:none'
in
info_tag
.
get
(
'style'
):
continue
else
:
info_name
=
info_tag
.
text
break
except
:
info_name
=
info_tag
.
text
break
if
info_name
:
pass
else
:
continue
# info_name = one_info.find('span').text
if
'审计意见'
in
info_name
:
continue
info_name_en
=
re
.
findall
(
'value
\
.(.*?)
\
)}}'
,
one_info
.
text
)[
0
]
...
...
@@ -229,9 +250,13 @@ def get_info(social_code, com_code,info_date,delist_all,info_date_list,taskType)
info_tag_list
=
one_info
.
find_all
(
'span'
)
info_name
=
''
for
info_tag
in
info_tag_list
:
if
'display:none'
in
info_tag
.
get
(
'style'
):
continue
else
:
try
:
if
'display:none'
in
info_tag
.
get
(
'style'
):
continue
else
:
info_name
=
info_tag
.
text
break
except
:
info_name
=
info_tag
.
text
break
if
info_name
:
...
...
@@ -299,7 +324,7 @@ def get_info(social_code, com_code,info_date,delist_all,info_date_list,taskType)
soup_name
=
BeautifulSoup
(
res_name
.
content
,
'html.parser'
)
# 第一个表
try
:
script_zcfzb
=
soup_name
.
find
(
'script'
,
{
'id'
:
'
cccccccccc
_qy'
})
script_zcfzb
=
soup_name
.
find
(
'script'
,
{
'id'
:
'
zcfzb
_qy'
})
if
script_zcfzb
:
soup_zcfzb
=
BeautifulSoup
(
script_zcfzb
.
text
.
strip
(),
'lxml'
)
else
:
...
...
@@ -371,9 +396,13 @@ def get_info(social_code, com_code,info_date,delist_all,info_date_list,taskType)
info_tag_list
=
one_info
.
find_all
(
'span'
)
info_name
=
''
for
info_tag
in
info_tag_list
:
if
'display:none'
in
info_tag
.
get
(
'style'
):
continue
else
:
try
:
if
'display:none'
in
info_tag
.
get
(
'style'
):
continue
else
:
info_name
=
info_tag
.
text
break
except
:
info_name
=
info_tag
.
text
break
if
info_name
:
...
...
@@ -397,7 +426,7 @@ def get_info(social_code, com_code,info_date,delist_all,info_date_list,taskType)
"name"
:
info_name
,
'enName'
:
info_name_en
,
"value"
:
info_data
,
"unit"
:
'元'
"unit"
:
"元"
}
list_zcfzb
.
append
(
dic_info_zcfzb
)
...
...
@@ -411,9 +440,13 @@ def get_info(social_code, com_code,info_date,delist_all,info_date_list,taskType)
info_tag_list
=
one_info
.
find_all
(
'span'
)
info_name
=
''
for
info_tag
in
info_tag_list
:
if
'display:none'
in
info_tag
.
get
(
'style'
):
continue
else
:
try
:
if
'display:none'
in
info_tag
.
get
(
'style'
):
continue
else
:
info_name
=
info_tag
.
text
break
except
:
info_name
=
info_tag
.
text
break
if
info_name
:
...
...
@@ -437,7 +470,7 @@ def get_info(social_code, com_code,info_date,delist_all,info_date_list,taskType)
"name"
:
info_name
,
'enName'
:
info_name_en
,
"value"
:
info_data
,
'unit'
:
'元'
"unit"
:
"元"
}
list_lrb
.
append
(
dic_info_lrb
)
...
...
@@ -451,9 +484,13 @@ def get_info(social_code, com_code,info_date,delist_all,info_date_list,taskType)
info_tag_list
=
one_info
.
find_all
(
'span'
)
info_name
=
''
for
info_tag
in
info_tag_list
:
if
'display:none'
in
info_tag
.
get
(
'style'
):
continue
else
:
try
:
if
'display:none'
in
info_tag
.
get
(
'style'
):
continue
else
:
info_name
=
info_tag
.
text
break
except
:
info_name
=
info_tag
.
text
break
if
info_name
:
...
...
@@ -477,7 +514,7 @@ def get_info(social_code, com_code,info_date,delist_all,info_date_list,taskType)
"name"
:
info_name
,
'enName'
:
info_name_en
,
"value"
:
info_data
,
'unit'
:
'元'
"unit"
:
"元"
}
list_xjllb
.
append
(
dic_info_xjllb
)
...
...
@@ -519,7 +556,7 @@ def getReportTime():
# list_date = ['2023-09-30','2023-06-30','2023-03-31']
list_month
=
[
'-12-31'
,
'-09-30'
,
'-06-30'
,
'-03-31'
]
for
year
in
range
(
year
,
2018
,
-
1
):
for
year
in
range
(
2018
,
year
+
1
):
for
month
in
list_month
[::
-
1
]:
date
=
str
(
year
)
+
month
#todo:判断拼接的报告期是否大于当前日期,如果大于当前日期,怎说明还没到这个时间,跳过
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论