Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王景浩
zzsn_spider
Commits
61beba6a
提交
61beba6a
authored
9月 08, 2023
作者:
薛凌堃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
9/8
上级
f5fc57ce
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
49 行删除
+10
-49
annualreportUS.py
comData/annualReport_XQW/annualreportUS.py
+10
-49
没有找到文件。
comData/annualReport_XQW/annualreportUS.py
浏览文件 @
61beba6a
...
...
@@ -130,56 +130,14 @@ def spider(com_name,cik):
soup
=
paserUrl
(
soup
,
news_url
)
content
=
soup
.
text
.
strip
()
# url = f'https://www.sec.gov/edgar/browse/?CIK={cik}&owner=exclude'
# browser.get(url)
# time.sleep(3)
# page_source = browser.page_source
# soup = BeautifulSoup(page_source, 'html.parser')
# # print(soup)
# select_ann = soup.find_all('tr', class_='odd')
#
# for tr in select_ann:
# form_type = tr.find('td').text
# if form_type == '20-F':
# # print(tr)
# # 获取原文链接
# href = tr.find('a', class_='document-link')['href']
# print(href)
# if 'ix?doc' in href:
# href = 'https://www.sec.gov/' + href.split('/ix?doc=/')[1]
# else:
# href = 'https://www.sec.gov' + href
# print(href)
# # 获取发布时间
# a_list = tr.find_all('a')
# # print(a_list)
# for a in a_list:
# text = a.text
# match = re.search(pattern, text)
# if match:
# pub_date = match.group(0)
# # print(pub_date)
# year = pub_date[:4]
# break
# else:
# pub_date = ''
# year = ''
# # 根据年报的链接,请求年报内容,不需要上传文件服务器,直接发送kafka
# browser.get(href)
# time.sleep(3)
# i_page_source = browser.page_source
# i_soup = BeautifulSoup(i_page_source, 'html.parser')
# # print(i_page_source)
# content = i_soup.text
# 采集下来正文内容,直接传输kafka
time_now
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
time
.
localtime
())
title
=
f
'{com_name}:{year}年年度报告'
log
.
info
(
f
'---{title}----采集完成----发送数据----'
)
dic_news
=
{
'attachmentIds'
:
''
,
'author'
:
''
,
'content'
:
content
,
'contentWithTag'
:
s
oup
,
'contentWithTag'
:
s
tr
(
soup
)
,
'createDate'
:
time_now
,
'deleteFlag'
:
'0'
,
'id'
:
''
,
...
...
@@ -218,6 +176,7 @@ def spider(com_name,cik):
'code'
:
'204'
,
'e'
:
e
}
log
.
info
(
f
'{dic_result}---{e}'
)
def
getrequest
(
social_code
,
url
,
headers
,
data
):
...
...
@@ -320,11 +279,13 @@ if __name__ == '__main__':
baseCore
.
recordLog
(
social_code
,
taskType
,
state
,
takeTime
,
''
,
exeception
)
continue
if
cik
is
None
:
exeception
=
'cik为空'
state
=
0
takeTime
=
baseCore
.
getTimeCost
(
start_time
,
time
.
time
())
baseCore
.
recordLog
(
social_code
,
taskType
,
state
,
takeTime
,
''
,
exeception
)
continue
cik
=
getCIK
(
social_code
,
code
)
if
cik
==
''
:
exeception
=
'cik为空'
state
=
0
takeTime
=
baseCore
.
getTimeCost
(
start_time
,
time
.
time
())
baseCore
.
recordLog
(
social_code
,
taskType
,
state
,
takeTime
,
''
,
exeception
)
continue
# code = 'BP'
# com_name = '英国石油公司'
# cik = ''
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论