Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
1f8cec67
提交
1f8cec67
authored
10月 09, 2023
作者:
薛凌堃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
雪球网企业年报上传obs
上级
4abbca5f
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
10 行删除
+10
-10
雪球网-年报.py
comData/annualReport/雪球网-年报.py
+10
-10
没有找到文件。
comData/annualReport/雪球网-年报.py
浏览文件 @
1f8cec67
# -*-
coding: utf-8 -*-
# -*-
coding: utf-8 -*-
...
@@ -152,24 +152,23 @@ def spider_annual_report(dict_info,num):
...
@@ -152,24 +152,23 @@ def spider_annual_report(dict_info,num):
cursor
.
execute
(
sel_sql
,
(
social_code
,
int
(
year
)))
cursor
.
execute
(
sel_sql
,
(
social_code
,
int
(
year
)))
selects
=
cursor
.
fetchone
()
selects
=
cursor
.
fetchone
()
if
selects
:
if
selects
:
print
(
f
'com_name:{com_name}、{year}已存在'
)
log
.
info
(
f
'com_name:{com_name}、{year}已存在'
)
continue
continue
else
:
else
:
page_size
=
0
#上传文件至obs服务器
#上传文件至文件服务器
retData
=
baseCore
.
uptoOBS
(
pdf_url
,
name_pdf
,
1
,
social_code
,
pathType
,
taskType
,
start_time
)
retData
=
baseCore
.
upLoadToServe
(
pdf_url
,
1
,
social_code
)
num
=
num
+
1
try
:
att_id
=
baseCore
.
tableUpdate
(
retData
,
com_name
,
year
,
name_pdf
,
num
)
content
=
retData
[
'content'
]
if
retData
[
'state'
]:
if
retData
[
'state'
]:
pass
pass
else
:
else
:
log
.
info
(
f
'====pdf解析失败===='
)
log
.
info
(
f
'====pdf解析失败===='
)
return
False
return
False
num
=
num
+
1
try
:
att_id
=
baseCore
.
tableUpdate
(
retData
,
com_name
,
year
,
name_pdf
,
num
)
content
=
retData
[
'content'
]
state
=
1
state
=
1
takeTime
=
baseCore
.
getTimeCost
(
start_time
,
time
.
time
())
takeTime
=
baseCore
.
getTimeCost
(
start_time
,
time
.
time
())
baseCore
.
recordLog
(
social_code
,
taskType
,
state
,
takeTime
,
year_url
,
''
)
baseCore
.
recordLog
(
social_code
,
taskType
,
state
,
takeTime
,
year_url
,
'
成功
'
)
except
:
except
:
exception
=
'数据库传输失败'
exception
=
'数据库传输失败'
state
=
0
state
=
0
...
@@ -236,6 +235,7 @@ def spider_annual_report(dict_info,num):
...
@@ -236,6 +235,7 @@ def spider_annual_report(dict_info,num):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
num
=
0
num
=
0
taskType
=
'企业年报/雪球网'
taskType
=
'企业年报/雪球网'
pathType
=
'XQWAnnualReport/'
while
True
:
while
True
:
start_time
=
time
.
time
()
start_time
=
time
.
time
()
# 获取企业信息
# 获取企业信息
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论