Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
2adbab73
提交
2adbab73
authored
10月 27, 2023
作者:
LiuLiYuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
政策法规 10/27
上级
c2749092
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
13 行增加
和
6 行删除
+13
-6
policy.py
comData/policylaw/policy.py
+13
-6
没有找到文件。
comData/policylaw/policy.py
浏览文件 @
2adbab73
...
...
@@ -397,7 +397,7 @@ def get_content2():
if
is_href
:
num
+=
1
log
.
info
(
'已采集----------跳过'
)
time
.
sleep
(
0.5
)
time
.
sleep
(
1
)
continue
try
:
resp
=
requests
.
get
(
url
=
href
,
headers
=
headers
,
verify
=
False
)
...
...
@@ -663,7 +663,8 @@ def bei_jing():
# bro = webdriver.Chrome(chrome_options=chrome_options, executable_path=r'D:/chrome/103/chromedriver.exe')
chrome_options
.
binary_location
=
r'D:\Google\Chrome\Application\chrome.exe'
chromedriver
=
r'D:\cmd100\chromedriver.exe'
bro
=
webdriver
.
Chrome
(
chrome_options
=
chrome_options
,
executable_path
=
chromedriver
)
#bro = webdriver.Chrome(chrome_options=chrome_options, executable_path=chromedriver)
bro
=
webdriver
.
Chrome
(
options
=
chrome_options
,
executable_path
=
chromedriver
)
with
open
(
'../../base/stealth.min.js'
)
as
f
:
js
=
f
.
read
()
...
...
@@ -1830,7 +1831,10 @@ def hai_nan():
href
=
'http://gzw.hainan.gov.cn/zwgk_23509/'
+
href
.
replace
(
'../../'
,
''
)
elif
'./'
in
href
:
href
=
href
.
replace
(
'./'
,
'http://gzw.hainan.gov.cn/zwgk_23509/zfwj/bmwj/'
)
is_href
=
db_storage
.
find_one
({
'网址'
:
href
})
try
:
is_href
=
db_storage
.
find_one
({
'网址'
:
href
.
split
(
'?'
)[
0
]})
except
:
is_href
=
db_storage
.
find_one
({
'网址'
:
href
})
if
is_href
:
num
+=
1
continue
...
...
@@ -1906,7 +1910,7 @@ def hai_nan():
pub_time
=
tbody_text
.
split
(
'发文日期:'
)[
1
]
.
split
(
'名 称:'
)[
0
]
.
strip
()
.
lstrip
()
.
replace
(
'年'
,
'-'
)
.
replace
(
'月'
,
'-'
)
.
replace
(
'日'
,
''
)
writtenDate
=
''
writtenDate
=
None
topicClassification
=
tbody_text
.
split
(
'分 类:'
)[
1
]
.
split
(
'发文机关:'
)[
0
]
.
strip
()
.
lstrip
()
contentWithTag
=
source
.
find
(
'div'
,
attrs
=
{
'class'
:
'zx-xxxqy-nr'
})
content
=
contentWithTag
.
text
...
...
@@ -1963,7 +1967,7 @@ def hai_nan():
0
]
.
strip
()
.
lstrip
()
pub_source
=
''
pub_hao
=
''
writtenDate
=
''
writtenDate
=
None
topicClassification
=
''
contentWithTag
=
source
.
find
(
'div'
,
attrs
=
{
'class'
:
'TRS_UEDITOR'
})
content
=
contentWithTag
.
text
...
...
@@ -2018,7 +2022,10 @@ def hai_nan():
title
=
str
(
doc_item
)
.
split
(
'target="_blank">'
)[
1
]
.
split
(
'</a>'
)[
0
]
href
=
'https://www.hainan.gov.cn'
+
str
(
doc_item
)
.
split
(
'href="'
)[
1
]
.
split
(
'" target'
)[
0
]
# print(title,href)
is_href
=
db_storage
.
find_one
({
'网址'
:
href
})
try
:
is_href
=
db_storage
.
find_one
({
'网址'
:
href
.
split
(
'?'
)[
0
]})
except
:
is_href
=
db_storage
.
find_one
({
'网址'
:
href
})
if
is_href
:
num
+=
1
continue
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论