Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
c0b05e59
提交
c0b05e59
authored
11月 23, 2023
作者:
薛凌堃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
11/23
上级
d4632531
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
131 行增加
和
5 行删除
+131
-5
RedisPPData.py
base/RedisPPData.py
+29
-1
CorePerson2.py
comData/Tyc/CorePerson2.py
+5
-4
updateyear.py
comData/annualReport1023/updateyear.py
+97
-0
东方财富网-公告.py
comData/noticeReport/东方财富网-公告.py
+0
-0
没有找到文件。
base/RedisPPData.py
浏览文件 @
c0b05e59
...
@@ -122,6 +122,33 @@ def NoticeEnterprise_task():
...
@@ -122,6 +122,33 @@ def NoticeEnterprise_task():
print
(
'定时采集异常'
,
e
)
print
(
'定时采集异常'
,
e
)
pass
pass
# 东方财富网公告 美股 港股
def
NoticeDF
():
cnx
,
cursor
=
connectSql
()
# 获取美股企业
mg_query
=
"SELECT a.SocialCode From EnterpriseInfo a ,EnterpriseType b WHERE a.SocialCode = b.SocialCode AND b.type=2 AND a.Place=0 AND SecuritiesCode is not null AND SecuritiesCode not LIKE '
%
.
%
'"
cursor
.
execute
(
mg_query
)
cnx
.
commit
()
mg_result
=
cursor
.
fetchall
()
mg_social_list
=
[
item
[
0
]
for
item
in
mg_result
]
print
(
'======='
)
for
item
in
mg_social_list
:
r
.
rpush
(
'NoticeEnterprise:mgqy_socialCode_add'
,
item
)
# 获取港股企业
gg_query
=
"SELECT a.SocialCode From EnterpriseInfo a ,EnterpriseType b WHERE a.SocialCode = b.SocialCode AND b.type=2 And SecuritiesCode like '
%
.HK'"
cursor
.
execute
(
gg_query
)
cnx
.
commit
()
gg_result
=
cursor
.
fetchall
()
gg_social_list
=
[
item
[
0
]
for
item
in
gg_result
]
print
(
'======='
)
for
item
in
gg_social_list
:
r
.
rpush
(
'NoticeEnterprise:ggqy_socialCode_add'
,
item
)
closeSql
(
cnx
,
cursor
)
#企业基本信息
#企业基本信息
def
BaseInfoEnterprise
():
def
BaseInfoEnterprise
():
cnx
,
cursor
=
connectSql
()
cnx
,
cursor
=
connectSql
()
...
@@ -564,7 +591,8 @@ if __name__ == "__main__":
...
@@ -564,7 +591,8 @@ if __name__ == "__main__":
# kegaishifan()
# kegaishifan()
# shuangbaiqiye()
# shuangbaiqiye()
# zhuangjingtexind()
# zhuangjingtexind()
NoticeEnterprise
()
# NoticeEnterprise()
NoticeDF
()
# AnnualEnterpriseIPO()
# AnnualEnterpriseIPO()
# AnnualEnterprise()
# AnnualEnterprise()
# BaseInfoEnterprise()
# BaseInfoEnterprise()
...
...
comData/Tyc/CorePerson2.py
浏览文件 @
c0b05e59
...
@@ -27,14 +27,15 @@ requests.adapters.DEFAULT_RETRIES = 5
...
@@ -27,14 +27,15 @@ requests.adapters.DEFAULT_RETRIES = 5
def
doJob
():
def
doJob
():
while
True
:
while
True
:
# 根据从Redis中拿到的社会信用代码,在数据库中获取对应基本信息
# 根据从Redis中拿到的社会信用代码,在数据库中获取对应基本信息
social_code
=
baseCore
.
redicPullData
(
'CorPersonEnterprise:gnqy_socialCode'
)
#
social_code = baseCore.redicPullData('CorPersonEnterprise:gnqy_socialCode')
# 判断 如果Redis中已经没有数据,则等待
# 判断 如果Redis中已经没有数据,则等待
# social_code = '92640302MA76KNNT0D'
social_code
=
'91510000207312079C'
if
'ZZSN'
in
social_code
:
continue
if
social_code
==
None
:
if
social_code
==
None
:
time
.
sleep
(
20
)
time
.
sleep
(
20
)
continue
continue
if
'ZZSN'
in
social_code
:
continue
start
=
time
.
time
()
start
=
time
.
time
()
try
:
try
:
# data = baseCore.getInfomation(social_code)
# data = baseCore.getInfomation(social_code)
...
...
comData/annualReport1023/updateyear.py
0 → 100644
浏览文件 @
c0b05e59
# -*- coding: utf-8 -*-
import
json
import
re
import
threading
import
time
import
uuid
import
fitz
import
redis
import
requests
from
bs4
import
BeautifulSoup
from
obs
import
ObsClient
from
retry
import
retry
from
elasticsearch
import
Elasticsearch
from
base
import
BaseCore
baseCore
=
BaseCore
.
BaseCore
()
log
=
baseCore
.
getLogger
()
baseCore
=
BaseCore
.
BaseCore
()
cnx_
=
baseCore
.
cnx_
cursor_
=
cnx_
.
cursor
()
lock
=
threading
.
Lock
()
pathType_
=
'QYResearchReport/'
taskType
=
'企业研报/东方财富网'
pool
=
redis
.
ConnectionPool
(
host
=
"114.115.236.206"
,
port
=
6379
,
password
=
'clbzzsn'
,
db
=
6
)
obsClient
=
ObsClient
(
access_key_id
=
'VEHN7D0TJ9316H8AHCAV'
,
# 你的华为云的ak码
secret_access_key
=
'heR353lvSWVPNU8pe2QxDtd8GDsO5L6PGH5eUoQY'
,
# 你的华为云的sk
server
=
'https://obs.cn-north-1.myhuaweicloud.com'
# 你的桶的地址
)
class
EsMethod
(
object
):
def
__init__
(
self
):
# 创建Elasticsearch对象,并提供账号信息
self
.
es
=
Elasticsearch
([
'http://114.116.19.92:9700'
],
http_auth
=
(
'elastic'
,
'zzsn9988'
),
timeout
=
300
)
self
.
index_name
=
'researchreportdata'
def
queryatt
(
self
,
index_name
,
id
):
body
=
{
"query"
:
{
"match"
:
{
"id"
:
id
}
}
}
filter_path
=
[
'hits.hits._id'
,
'hits.total.value'
,
'hits.hits._source.title'
,
'hits.hits._source.origin'
,
'hits.hits._source.sourceAddress'
,
'hits.hits._source.createDate'
,
'hits.hits._source.publishDate'
,
]
# 字段2
result
=
self
.
es
.
search
(
index
=
index_name
,
doc_type
=
'_doc'
,
filter_path
=
filter_path
,
body
=
body
)
# log.info(result)
return
result
def
updateaunn
(
self
,
index_name
,
id
,
u_publishDate
):
body
=
{
'doc'
:
{
'publishDate'
:
u_publishDate
}
}
result
=
self
.
es
.
update
(
index
=
index_name
,
id
=
id
,
body
=
body
)
log
.
info
(
'更新结果:
%
s'
%
result
)
if
__name__
==
"__main__"
:
esMethod
=
EsMethod
()
redis_conn
=
redis
.
Redis
(
connection_pool
=
pool
)
while
True
:
id_
=
redis_conn
.
lpop
(
'YanBao:up'
)
# id = "23112104300"
if
id
:
pass
else
:
log
.
info
(
'已无数据'
)
id
=
id_
.
decode
()
result_
=
esMethod
.
queryatt
(
index_name
=
esMethod
.
index_name
,
id
=
id
)
result
=
result_
[
'hits'
][
'hits'
][
0
]
num
=
0
publishDate
=
result
[
'_source'
][
'publishDate'
]
u_publishDate
=
'2023-08-31'
#+ publishDate.split('T')[1]
esMethod
.
updateaunn
(
esMethod
.
index_name
,
str
(
id
),
u_publishDate
)
comData/noticeReport/东方财富网-公告.py
浏览文件 @
c0b05e59
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论