Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
864508c6
提交
864508c6
authored
10月 11, 2023
作者:
刘伟刚
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
aff90fb2
560ca32c
全部展开
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
7 行增加
和
7 行删除
+7
-7
nyse_news_gn.py
comData/sinafinance_news/nyse_news_gn.py
+1
-1
nyse_news_xg.py
comData/sinafinance_news/nyse_news_xg.py
+6
-6
nyse_notice_gn.py
comData/sinafinance_news/nyse_notice_gn.py
+0
-0
没有找到文件。
comData/sinafinance_news/nyse_news_gn.py
浏览文件 @
864508c6
...
...
@@ -27,7 +27,7 @@ headers = {
'Cache-Control'
:
'no-cache'
,
'Pragma'
:
'no-cache'
}
taskType
=
'企业动态/新浪财经'
taskType
=
'企业动态/新浪财经
/国内
'
pattern
=
r"\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}"
# 获取响应页面
...
...
comData/sinafinance_news/nyse_news_xg.py
浏览文件 @
864508c6
...
...
@@ -28,7 +28,7 @@ headers = {
'Cache-Control'
:
'no-cache'
,
'Pragma'
:
'no-cache'
}
taskType
=
'企业动态/新浪财经'
taskType
=
'企业动态/新浪财经
/香港
'
# 判断时间是否是正确格式
...
...
@@ -51,7 +51,7 @@ def format_time(time_str):
def
getrequests
(
url
):
ip
=
baseCore
.
get_proxy
()
req
=
requests
.
get
(
url
,
headers
=
headers
,
proxies
=
ip
)
req
.
encoding
=
req
.
apparent_encoding
req
.
encoding
=
'gbk'
soup
=
BeautifulSoup
(
req
.
text
,
'html.parser'
)
return
soup
...
...
@@ -117,7 +117,7 @@ def getDic(social_code, title, href, pub_time):
# state = 0
# takeTime = baseCore.getTimeCost(start_time, time.time())
# baseCore.recordLog(social_code, taskType, state, takeTime, href, f'{href}===发送Kafka失败')
#
return 1
return
1
# 数据发送至Kafka
...
...
@@ -165,10 +165,10 @@ def selectUrl(url, social_code):
def
doJob
():
#
while True:
while
True
:
start_time
=
time
.
time
()
#
social_code = baseCore.redicPullData('NewsEnterprise:xgqy_nyse_socialCode')
social_code
=
'91330000747735638J'
social_code
=
baseCore
.
redicPullData
(
'NewsEnterprise:xgqy_nyse_socialCode'
)
#
social_code = '91330000747735638J'
if
not
social_code
or
social_code
==
'None'
:
time
.
sleep
(
20
)
data
=
baseCore
.
getInfomation
(
social_code
)
...
...
comData/sinafinance_news/nyse_notice_gn.py
0 → 100644
浏览文件 @
864508c6
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论