Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
c442ebb4
提交
c442ebb4
authored
2月 20, 2024
作者:
薛凌堃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
天眼查核心人员更新
上级
0fe52c2b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
25 行增加
和
12 行删除
+25
-12
CorePerson.py
comData/Tyc/CorePerson.py
+25
-12
CorePerson_Update.py
comData/Tyc/CorePerson_Update.py
+0
-0
没有找到文件。
comData/Tyc/CorePerson.py
浏览文件 @
c442ebb4
...
...
@@ -45,15 +45,18 @@ def get_html(tycid, s, headers):
# div_part.find('div', class_='dimHeader_root__XTCLe')
except
:
return
-
1
try
:
tmp_field
=
div_part
.
find
(
'div'
,
class_
=
'dim-tab-root'
)
.
find
(
'span'
)
.
text
if
'最新公示'
in
tmp_field
:
total
=
div_part
.
find
(
'div'
,
class_
=
'dim-tab-root'
)
.
find
(
'span'
)
.
get_text
()
.
split
(
'最新公示'
)[
1
]
.
replace
(
' '
,
''
)
return
int
(
total
)
else
:
return
-
1
except
:
return
0
if
div_part
is
None
:
return
-
2
else
:
try
:
tmp_field
=
div_part
.
find
(
'div'
,
class_
=
'dim-tab-root'
)
.
find
(
'span'
)
.
text
if
'最新公示'
in
tmp_field
:
total
=
div_part
.
find
(
'div'
,
class_
=
'dim-tab-root'
)
.
find
(
'span'
)
.
get_text
()
.
split
(
'最新公示'
)[
1
]
.
replace
(
' '
,
''
)
return
int
(
total
)
else
:
return
-
1
except
:
return
0
@retry
(
tries
=
3
,
delay
=
1
)
...
...
@@ -64,7 +67,10 @@ def get_page(url, s, headers):
if
res
.
status_code
!=
200
:
raise
data_page
=
res
.
json
()
total_page_
=
data_page
[
'data'
][
'total'
]
try
:
total_page_
=
data_page
[
'data'
][
'total'
]
except
:
raise
return
total_page_
...
...
@@ -77,7 +83,7 @@ def doJob():
'Accept-Encoding'
:
'gzip, deflate, br'
,
'Accept-Language'
:
'zh-CN,zh;q=0.9'
,
'Cache-Control'
:
'max-age=0'
,
'Connection'
:
'keep-alive'
,
#
'Connection': 'keep-alive',
'User-Agent'
:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
,
'version'
:
'TYC-Web'
}
...
...
@@ -90,7 +96,7 @@ def doJob():
# 根据从Redis中拿到的社会信用代码,在数据库中获取对应基本信息
# social_code = baseCore.redicPullData('CorPersonEnterprise:gnqy_socialCode')
# 判断 如果Redis中已经没有数据,则等待
social_code
=
'91
440300MA5EU1QM0T
'
social_code
=
'91
110108780992804C
'
if
social_code
==
None
:
time
.
sleep
(
20
)
continue
...
...
@@ -163,6 +169,11 @@ def doJob():
log
.
info
(
f
"{id}---{xydm}----{tycid}----请求失败----重新放入redis"
)
time
.
sleep
(
2
)
continue
elif
charge
==
-
2
:
# 该企业没有人员信息
log
.
info
(
f
"{id}---{xydm}----{tycid}----没有核心人员"
)
continue
elif
charge
==
0
:
log
.
info
(
f
"{id}---{xydm}----{tycid}----没有最新公示"
)
url1
=
f
'https://capi.tianyancha.com/cloud-company-background/company/dim/staff?_={t}&gid={tycid}&pageSize=20&pageNum=1'
...
...
@@ -240,6 +251,8 @@ def doJob():
pass
else
:
log
.
info
(
f
'{id}---{xydm}----{tycid}----没有高管信息'
)
# todo: 关闭连接
res
.
close
()
if
flag
==
1
:
for
one_info
in
list_all
:
name
=
one_info
[
'name'
]
...
...
comData/Tyc/CorePerson_Update.py
0 → 100644
浏览文件 @
c442ebb4
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论