Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
丁双波
zzsn_spider
Commits
0ce37662
提交
0ce37662
authored
1月 24, 2024
作者:
薛凌堃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1/24
上级
edc0ae0e
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
37 行增加
和
4 行删除
+37
-4
baseinfo1122.py
comData/BaseInfo_qcc/baseinfo1122.py
+13
-1
get_tokenCookies.py
comData/weixin_solo/get_tokenCookies.py
+1
-1
oneWeixin2.py
comData/weixin_solo/oneWeixin2.py
+9
-2
wxList.py
comData/weixin_solo/wxList.py
+14
-0
没有找到文件。
comData/BaseInfo_qcc/baseinfo1122.py
浏览文件 @
0ce37662
...
...
@@ -55,7 +55,19 @@ def baseinfo(com_soup):
data
=
{}
for
cominfo
in
cominfo_list
:
# print(cominfo)
value
=
cominfo
.
find
(
'span'
,
class_
=
'val'
)
.
text
.
replace
(
'复制'
,
''
)
.
strip
(
' '
)
try
:
value
=
cominfo
.
find
(
'span'
,
class_
=
'val'
)
.
text
.
replace
(
'复制'
,
''
)
.
strip
(
' '
)
except
:
try
:
value_tags
=
cominfo
.
find_all
(
'span'
)
for
_
in
value_tags
:
if
len
(
_
.
attrs
)
==
0
:
value
=
_
.
text
.
replace
(
'复制'
,
''
)
.
strip
(
' '
)
break
else
:
return
data
except
:
return
data
pattern
=
r'\(\d{4}\s*年\)'
match
=
re
.
search
(
pattern
,
value
)
if
match
:
...
...
comData/weixin_solo/get_tokenCookies.py
浏览文件 @
0ce37662
...
...
@@ -56,7 +56,7 @@ if __name__=="__main__":
url
=
"https://mp.weixin.qq.com/"
browser
.
get
(
url
)
# 可改动
time
.
sleep
(
2
0
)
time
.
sleep
(
7
0
)
s
=
requests
.
session
()
#获取到token和cookies
...
...
comData/weixin_solo/oneWeixin2.py
浏览文件 @
0ce37662
...
...
@@ -32,8 +32,15 @@ def updatewxLink(link,info_source_code,state):
def
getjsonInfo
():
# todo:从redis中获取一条
linkid
=
baseCore
.
redicPullData
(
'WeiXinGZH:linkid'
)
if
linkid
:
pass
else
:
log
.
info
(
'-----没有数据了-----'
)
return
False
#从数据库中获取信息 一条
select_sql
=
"select * from wx_link where state=0 order by id asc limit 1
"
select_sql
=
f
"select * from wx_link where state=0 and id= '{linkid}'
"
cursor_
.
execute
(
select_sql
)
row
=
cursor_
.
fetchone
()
cnx_
.
commit
()
...
...
@@ -241,7 +248,7 @@ if __name__=="__main__":
#一次拿取一篇文章
# todo: 从redis拿数据 更新mysql状态
dict_json
=
getjsonInfo
()
dict_json
=
getjsonInfo
()
if
dict_json
:
if
get_info
(
dict_json
):
num_caiji
=
num_caiji
+
1
...
...
comData/weixin_solo/wxList.py
浏览文件 @
0ce37662
...
...
@@ -4,6 +4,7 @@ import time
import
random
import
pymysql
import
redis
import
requests
import
urllib3
from
pymysql.converters
import
escape_string
...
...
@@ -113,7 +114,20 @@ def insertWxList(dic_url,json_search,page):
cnx_
.
commit
()
except
Exception
as
e
:
log
.
error
(
f
"保存数据库失败:{e}"
)
# 查询放入之后的id
selectIdSql
=
f
"select id from wx_link where sid='{dic_url['sid']}' and link='{escape_string(url_news)}'"
cursor_
.
execute
(
selectIdSql
)
linkid
=
cursor_
.
fetchone
()[
0
]
# todo: 放入redis
try
:
r
.
ping
()
except
:
r_
=
redis
.
Redis
(
host
=
"114.115.236.206"
,
port
=
6379
,
password
=
'clbzzsn'
,
db
=
6
)
r_
.
lpush
(
'WeiXinGZH:url'
,
linkid
)
continue
r
.
lpush
(
'WeiXinGZH:linkid'
,
linkid
)
log
.
info
(
f
"---{dic_url['name']}--第{page}页----总数:{listCount}---重复数:{repetCount}---新增数:{insertCount}-------------"
)
if
listCount
==
0
:
#列表为空认为结束
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论