Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
0227ff97
提交
0227ff97
authored
11月 15, 2023
作者:
薛凌堃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
11/15
上级
bed1863a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
44 行增加
和
13 行删除
+44
-13
BaseCore.py
base/BaseCore.py
+15
-1
baseinfo1113.py
comData/BaseInfo_qcc/baseinfo1113.py
+0
-0
requestQCC.py
comData/BaseInfo_qcc/requestQCC.py
+11
-3
公告补采1.py
comData/noticeReport/公告补采1.py
+15
-6
公告补采2.py
comData/noticeReport/公告补采2.py
+3
-3
没有找到文件。
base/BaseCore.py
浏览文件 @
0227ff97
...
...
@@ -286,6 +286,20 @@ class BaseCore:
charset
=
'utf8mb4'
)
self
.
pool_11
=
PooledDB
(
creator
=
pymysql
,
maxconnections
=
5
,
mincached
=
2
,
maxcached
=
5
,
blocking
=
True
,
host
=
'114.116.44.11'
,
port
=
3306
,
user
=
'caiji'
,
password
=
'f7s0&7qqtK'
,
database
=
'clb_project'
,
charset
=
'utf8mb4'
)
def
check_mysql_conn
(
self
,
conn
):
try
:
conn
.
ping
()
...
...
@@ -864,7 +878,7 @@ class BaseCore:
# 发送邮箱地址
sender
=
'1195236739@qq.com'
# 接收邮箱地址
receiver
=
'10
74481431
@qq.com'
receiver
=
'10
07765445
@qq.com'
smtpserver
=
'smtp.qq.com'
# 发送邮箱登录 账户 密码
username
=
'1195236739@qq.com'
...
...
comData/BaseInfo_qcc/baseinfo1113.py
浏览文件 @
0227ff97
差异被折叠。
点击展开。
comData/BaseInfo_qcc/requestQCC.py
浏览文件 @
0227ff97
...
...
@@ -13,6 +13,8 @@ from selenium.webdriver.support import expected_conditions as EC
from
base.BaseCore
import
BaseCore
baseCore
=
BaseCore
()
log
=
baseCore
.
getLogger
()
cnx_
=
baseCore
.
cnx
cursor_
=
baseCore
.
cursor
def
createDriver
():
chrome_driver
=
r'D:\cmd100\chromedriver.exe'
path
=
Service
(
chrome_driver
)
...
...
@@ -32,10 +34,16 @@ def flushAndGetToken():
for
cookie
in
cookie_list
:
cookies
[
cookie
[
'name'
]]
=
cookie
[
'value'
]
print
(
cookies
)
insert
=
f
"insert into QCC_token (token,cookies,create_time,fenghao_time,user_name,update_time) values ('{token}','{escape_string(cookies)}',now(),DATE_SUB(NOW(), INTERVAL 1 DAY),'{user_name}',now())"
cursor_
.
execute
(
insert
)
cnx_
.
commit
()
baseCore
.
close
()
def
getrequest_soup
(
headers
,
url
):
req
=
requests
.
get
(
headers
=
headers
,
url
=
url
)
result
=
BeautifulSoup
(
req
.
content
,
'html.parser'
)
req
=
requests
.
get
(
headers
=
headers
,
url
=
url
)
result
=
BeautifulSoup
(
req
.
content
,
'html.parser'
)
return
result
def
dojob
():
...
...
@@ -57,7 +65,7 @@ def dojob():
'Upgrade-Insecure-Requests'
:
'1'
,
'User-Agent'
:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
}
url
=
'https://www.qcc.com/
web/search?key=
%
E5
%
B0
%8
F
%
E7
%
B1
%
B3
%
E9
%80%9
A
%
E8
%
AE
%
AF
%
E6
%8
A
%80%
E6
%9
C
%
AF
%
E6
%9
C
%89%
E9
%99%90%
E5
%85%
AC
%
E5
%8
F
%
B8
'
url
=
'https://www.qcc.com/
api/userCenter/getAuthInfo
'
soup
=
getrequest_soup
(
headers
,
url
)
pass
...
...
comData/noticeReport/公告补采1.py
浏览文件 @
0227ff97
"""
"""
...
...
@@ -19,12 +19,12 @@ from urllib.parse import unquote
baseCore
=
BaseCore
.
BaseCore
()
log
=
baseCore
.
getLogger
()
baseCore
=
BaseCore
.
BaseCore
()
local
=
threading
.
local
()
cnx
=
baseCore
.
cnx
cursor
=
baseCore
.
cursor
# 使用连接池
cnx_
=
baseCore
.
pool_11
.
connection
()
cursor_
=
cnx_
.
cursor
()
cnx_
=
baseCore
.
cnx_
cursor_
=
baseCore
.
cursor_
pathType
=
'QYNotice/'
taskType
=
'企业公告/证监会'
obsClient
=
ObsClient
(
...
...
@@ -102,6 +102,14 @@ class EsMethod(object):
log
.
info
(
'更新结果:
%
s'
%
result
)
# 获取当前线程的数据库连接
def
get_connection
():
# 检查当前线程是否已经有连接对象
if
not
hasattr
(
local
,
'conn'
):
# 如果没有,则创建一个连接对象并保存到thread-local中
local
.
conn
=
baseCore
.
pool_11
.
connection
()
return
local
.
conn
def
getuuid
():
get_timestamp_uuid
=
uuid
.
uuid1
()
# 根据 时间戳生成 uuid , 保证全球唯一
return
get_timestamp_uuid
...
...
@@ -211,6 +219,7 @@ def tableUpdate(retData, year, pdf_name, num,pub_time,origin):
status
,
create_by
,
create_time
,
page_size
,
full_path
.
split
(
'https://zzsn.obs.cn-north-1.myhuaweicloud.com/'
)[
1
],
'zzsn'
,
pub_time
,
origin
)
cursor_
.
execute
(
Upsql
,
values
)
# 插入
cnx_
.
commit
()
# 提交
except
Exception
as
e
:
...
...
@@ -236,7 +245,7 @@ def upload(sourceAddress,num,title,social_code,year,publishDate,createDate):
return
att_id
else
:
return
None
from
multiprocessing
import
Process
,
Queue
def
main
(
page
,
p
,
esMethod
):
# esMethod = EsMethod()
# esMethod.getFileds(index_name=esMethod.index_name)
...
...
comData/noticeReport/公告补采2.py
浏览文件 @
0227ff97
"""
"""
...
...
@@ -53,7 +53,7 @@ class EsMethod(object):
},
{
"wildcard"
:
{
"attachmentIds.keyword"
:
"
None
"
"attachmentIds.keyword"
:
"
911*
"
}
}
]
...
...
@@ -62,7 +62,7 @@ class EsMethod(object):
"sort"
:
[
{
"createDate"
:
{
"order"
:
"
de
sc"
"order"
:
"
a
sc"
}
}
],
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论