Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
19e70d94
提交
19e70d94
authored
9月 28, 2023
作者:
薛凌堃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
9/28
上级
af03b018
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
43 行增加
和
18 行删除
+43
-18
RedisPPData.py
base/RedisPPData.py
+15
-0
CorePerson.py
comData/Tyc/CorePerson.py
+2
-2
annualreportUS.py
comData/annualReport_US/annualreportUS.py
+2
-2
新三板--公告.py
comData/dfcfwGpdm/NQenterprise/新三板--公告.py
+23
-13
get_tokenCookies.py
comData/weixin_solo/get_tokenCookies.py
+1
-1
没有找到文件。
base/RedisPPData.py
浏览文件 @
19e70d94
...
@@ -449,6 +449,21 @@ def omeng():
...
@@ -449,6 +449,21 @@ def omeng():
# r.rpush('gnOMEnterprise_socialcode:Notice', item)
# r.rpush('gnOMEnterprise_socialcode:Notice', item)
closeSql
(
cnx
,
cursor
)
closeSql
(
cnx
,
cursor
)
#单项冠军
def
danxiangguanjun
():
pass
#科改示范
def
kegaishifan
():
pass
#双百企业
def
shuangbaiqiye
():
pass
#专精特新
def
zhuangjingtexind
():
pass
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
start
=
time
.
time
()
start
=
time
.
time
()
...
...
comData/Tyc/CorePerson.py
浏览文件 @
19e70d94
...
@@ -46,8 +46,8 @@ def doJob():
...
@@ -46,8 +46,8 @@ def doJob():
if
tycid
==
None
or
tycid
==
''
:
if
tycid
==
None
or
tycid
==
''
:
try
:
try
:
retData
=
getTycIdByXYDM
(
xydm
)
retData
=
getTycIdByXYDM
(
xydm
)
if
retData
:
if
retData
[
'state'
]
:
tycid
=
retData
[
'id'
]
tycid
=
retData
[
'
tycData'
][
'
id'
]
# todo:写入数据库
# todo:写入数据库
updateSql
=
f
"update EnterpriseInfo set TYCID = '{tycid}' where SocialCode = '{xydm}'"
updateSql
=
f
"update EnterpriseInfo set TYCID = '{tycid}' where SocialCode = '{xydm}'"
cursor_
.
execute
(
updateSql
)
cursor_
.
execute
(
updateSql
)
...
...
comData/annualReport_US/annualreportUS.py
浏览文件 @
19e70d94
...
@@ -101,8 +101,8 @@ def spider(com_name,cik,up_okCount):
...
@@ -101,8 +101,8 @@ def spider(com_name,cik,up_okCount):
#解析页面
#解析页面
for
nnn
in
range
(
0
,
4
):
for
nnn
in
range
(
0
,
4
):
try
:
try
:
req
=
requests
.
get
(
url
=
url_json
,
headers
=
header
,
proxies
=
ip_dic
,
verify
=
False
,
timeout
=
30
)
#
req = requests.get(url=url_json,headers=header,proxies=ip_dic,verify=False,timeout=30)
#
req = requests.get(url=url_json, headers=header, verify=False, timeout=30)
req
=
requests
.
get
(
url
=
url_json
,
headers
=
header
,
verify
=
False
,
timeout
=
30
)
break
break
except
:
except
:
time
.
sleep
(
2
)
time
.
sleep
(
2
)
...
...
comData/dfcfwGpdm/NQenterprise/新三板--公告.py
浏览文件 @
19e70d94
...
@@ -41,6 +41,14 @@ type_map = {
...
@@ -41,6 +41,14 @@ type_map = {
'9605'
:
'公司公告'
,
'9605'
:
'公司公告'
,
'9533'
:
'公司公告'
,
'9533'
:
'公司公告'
,
}
}
type_id_map
=
{
'公司公告'
:
'8'
,
'股转公告'
:
'9'
,
'挂牌审核'
:
'10'
,
'自律监管措施'
:
'11'
,
'问询函'
:
'12'
,
'纪律处分'
:
'13'
}
def
secrchATT
(
item_id
,
name
,
type_id
):
def
secrchATT
(
item_id
,
name
,
type_id
):
sel_sql
=
'''select id from clb_sys_attachment where item_id =
%
s and name =
%
s and type_id=
%
s '''
sel_sql
=
'''select id from clb_sys_attachment where item_id =
%
s and name =
%
s and type_id=
%
s '''
...
@@ -157,7 +165,7 @@ def InsterInto(short_name, social_code, pdf_url):
...
@@ -157,7 +165,7 @@ def InsterInto(short_name, social_code, pdf_url):
return
insert
return
insert
def
GetContent
(
pdf_url
,
pdf_name
,
social_code
,
year
,
pub_time
,
start_time
,
com_name
,
num
):
def
GetContent
(
pdf_url
,
pdf_name
,
social_code
,
year
,
pub_time
,
start_time
,
com_name
,
num
,
kfkid
):
#上传至文件服务器
#上传至文件服务器
retData
=
baseCore
.
upLoadToServe
(
pdf_url
,
8
,
social_code
)
retData
=
baseCore
.
upLoadToServe
(
pdf_url
,
8
,
social_code
)
#附件插入att数据库
#附件插入att数据库
...
@@ -192,7 +200,7 @@ def GetContent(pdf_url, pdf_name, social_code, year, pub_time, start_time,com_na
...
@@ -192,7 +200,7 @@ def GetContent(pdf_url, pdf_name, social_code, year, pub_time, start_time,com_na
'sourceAddress'
:
pdf_url
,
# 原文链接
'sourceAddress'
:
pdf_url
,
# 原文链接
'summary'
:
''
,
'summary'
:
''
,
'title'
:
pdf_name
,
'title'
:
pdf_name
,
'type'
:
3
,
'type'
:
kfkid
,
'socialCreditCode'
:
social_code
,
'socialCreditCode'
:
social_code
,
'year'
:
year
'year'
:
year
}
}
...
@@ -241,6 +249,7 @@ def SpiderByZJH(url, dic_info, start_time,num): # dic_info 数据库中获取
...
@@ -241,6 +249,7 @@ def SpiderByZJH(url, dic_info, start_time,num): # dic_info 数据库中获取
pdf_url
=
'https://www.neeq.com.cn'
+
rp
[
'destFilePath'
]
pdf_url
=
'https://www.neeq.com.cn'
+
rp
[
'destFilePath'
]
name_pdf
=
rp
[
'disclosureTitle'
]
name_pdf
=
rp
[
'disclosureTitle'
]
rp_type
=
type_map
[
rp
[
'disclosureType'
]]
rp_type
=
type_map
[
rp
[
'disclosureType'
]]
kfkid
=
type_id_map
[
rp_type
]
publishDate
=
rp
[
'publishDate'
]
publishDate
=
rp
[
'publishDate'
]
year
=
publishDate
[:
4
]
year
=
publishDate
[:
4
]
# 数据入库
# 数据入库
...
@@ -250,7 +259,7 @@ def SpiderByZJH(url, dic_info, start_time,num): # dic_info 数据库中获取
...
@@ -250,7 +259,7 @@ def SpiderByZJH(url, dic_info, start_time,num): # dic_info 数据库中获取
# okCount = okCount + 1
# okCount = okCount + 1
# 解析PDF内容,先获取PDF链接 下载 解析成功,解析失败 ,传输成功,传输失败
# 解析PDF内容,先获取PDF链接 下载 解析成功,解析失败 ,传输成功,传输失败
log
.
info
(
f
'======={short_name}===========插入公告库成功'
)
log
.
info
(
f
'======={short_name}===========插入公告库成功'
)
result
=
GetContent
(
pdf_url
,
name_pdf
,
social_code
,
year
,
publishDate
,
start_time
,
com_name
,
num
)
result
=
GetContent
(
pdf_url
,
name_pdf
,
social_code
,
year
,
publishDate
,
start_time
,
com_name
,
num
,
kfkid
)
if
result
:
if
result
:
# 公告信息列表
# 公告信息列表
...
@@ -300,17 +309,18 @@ if __name__ == '__main__':
...
@@ -300,17 +309,18 @@ if __name__ == '__main__':
while
True
:
while
True
:
start_time
=
time
.
time
()
start_time
=
time
.
time
()
# # 获取企业信息
# # 获取企业信息
# # social_code = baseCore.redicPullData('NoticeEnterpriseFbs:gnqy_socialCod
e')
social_code
=
baseCore
.
redicPullData
(
'NQEnterprise:nq_financ
e'
)
social_code
=
'9110000071092841XX'
#
social_code = '9110000071092841XX'
com_code
=
'430045'
#
com_code = '430045'
short_name
=
'超毅网络'
#
short_name = '超毅网络'
dic_info
=
{}
dic_info
=
{}
# # 判断 如果Redis中已经没有数据,则等待
# # 判断 如果Redis中已经没有数据,则等待
# if social_code == None:
if
social_code
==
None
:
# time.sleep(20)
time
.
sleep
(
20
)
# continue
continue
# dic_info = baseCore.getInfomation(social_code)
data
=
baseCore
.
getInfomation
(
social_code
)
# count = dic_info[16]
com_code
=
data
[
3
]
short_name
=
data
[
4
]
url
=
'https://www.neeq.com.cn/disclosureInfoController/productInfoResult.do'
url
=
'https://www.neeq.com.cn/disclosureInfoController/productInfoResult.do'
#翻页 page 0~ 25 totalPages
#翻页 page 0~ 25 totalPages
...
...
comData/weixin_solo/get_tokenCookies.py
浏览文件 @
19e70d94
...
@@ -56,7 +56,7 @@ if __name__=="__main__":
...
@@ -56,7 +56,7 @@ if __name__=="__main__":
url
=
"https://mp.weixin.qq.com/"
url
=
"https://mp.weixin.qq.com/"
browser
.
get
(
url
)
browser
.
get
(
url
)
# 可改动
# 可改动
time
.
sleep
(
6
0
)
time
.
sleep
(
2
0
)
s
=
requests
.
session
()
s
=
requests
.
session
()
#获取到token和cookies
#获取到token和cookies
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论