Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
75a87d7f
提交
75a87d7f
authored
8月 15, 2023
作者:
薛凌堃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微信公众号
上级
0b2f4ac1
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
5 行删除
+6
-5
oneWeixin.py
comData/weixin_solo/oneWeixin.py
+6
-5
没有找到文件。
comData/weixin_solo/oneWeixin.py
浏览文件 @
75a87d7f
...
@@ -232,7 +232,7 @@ def rePutIntoR(item):
...
@@ -232,7 +232,7 @@ def rePutIntoR(item):
r
.
rpush
(
'WeiXinGZH:infoSourceCode'
,
item
)
r
.
rpush
(
'WeiXinGZH:infoSourceCode'
,
item
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
requests
.
DEFAULT_RETRIES
=
5
time_start
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
time
.
localtime
())
time_start
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
time
.
localtime
())
print
(
f
'开始时间为:{time_start}'
)
print
(
f
'开始时间为:{time_start}'
)
...
@@ -300,6 +300,7 @@ if __name__=="__main__":
...
@@ -300,6 +300,7 @@ if __name__=="__main__":
log
.
info
(
'===========获取biz=========='
)
log
.
info
(
'===========获取biz=========='
)
s
.
cookies
.
update
(
cookies
)
s
.
cookies
.
update
(
cookies
)
s
.
keep_alive
=
False
url_
=
dic_url
[
'url_'
]
url_
=
dic_url
[
'url_'
]
origin
=
dic_url
[
'name'
]
origin
=
dic_url
[
'name'
]
info_source_code
=
dic_url
[
'info_source_code'
]
info_source_code
=
dic_url
[
'info_source_code'
]
...
@@ -332,8 +333,8 @@ if __name__=="__main__":
...
@@ -332,8 +333,8 @@ if __name__=="__main__":
str_t
=
json
.
dumps
(
json_search
)
str_t
=
json
.
dumps
(
json_search
)
time
.
sleep
(
2
)
time
.
sleep
(
2
)
except
:
except
Exception
as
e
:
log
.
error
(
f
'===公众号{origin}请求失败!当前时间:{baseCore.getNowTime(1)}==='
)
log
.
error
(
f
'===公众号{origin}请求失败!当前时间:{baseCore.getNowTime(1)}===
===={e}===
'
)
rePutIntoR
(
info_source_code
)
rePutIntoR
(
info_source_code
)
continue
continue
#{"base_resp": {"ret": 200003, "err_msg": "invalid session"}}
#{"base_resp": {"ret": 200003, "err_msg": "invalid session"}}
...
@@ -416,8 +417,8 @@ if __name__=="__main__":
...
@@ -416,8 +417,8 @@ if __name__=="__main__":
origin
,
origin
,
url_
,
url_
,
info_source_code
,
info_source_code
,
num_caiji
,
'采集成功'
,
'采集成功'
,
num_caiji
,
time_now
time_now
]
]
#成功信息保存
#成功信息保存
...
@@ -440,7 +441,7 @@ if __name__=="__main__":
...
@@ -440,7 +441,7 @@ if __name__=="__main__":
'采集失败'
,
'采集失败'
,
time_now
time_now
]
]
#
成功
信息保存
#
失败
信息保存
insertSql
=
f
"insert into WeixinGZH (site_name,site_url,info_source_code,json_error_info,error_type,create_time) values (
%
s,
%
s,
%
s,
%
s,
%
s,
%
s)"
insertSql
=
f
"insert into WeixinGZH (site_name,site_url,info_source_code,json_error_info,error_type,create_time) values (
%
s,
%
s,
%
s,
%
s,
%
s,
%
s)"
cursor_
.
execute
(
insertSql
,
tuple
(
false
))
cursor_
.
execute
(
insertSql
,
tuple
(
false
))
cnx_
.
commit
()
cnx_
.
commit
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论