Toggle navigation
Toggle navigation
This project
Loading...
Sign in
万朱浩
/
Venue-Ops
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
kpt
2024-07-03 19:59:09 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
8eae8341fc143621d746b048a64ba24594c9f7fa
8eae8341
2 parents
6cf1cee8
11f993fe
Merge branch 'main' of
https://github.com/666ghj/Weibo_PublicOpinion_AnalysisSystem
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
spider/article.csv
spider/saveData.py
spider/article.csv
deleted
100644 → 0
View file @
6cf1cee
id,likeNum,commentsLen,reposts_count,region,content,contentLen,created_at,type,detailUrl,authorAvatar,authorName,authorDetail,isVip
spider/saveData.py
View file @
8eae834
...
...
@@ -20,13 +20,13 @@ def save_to_sql():
concatArticlePd
.
to_sql
(
'article'
,
con
=
engine
,
if_exists
=
'replace'
,
index
=
False
)
concatCommentsPd
.
to_sql
(
'comments'
,
con
=
engine
,
if_exists
=
'replace'
,
index
=
False
)
except
:
articleNewPd
=
pd
.
read_csv
(
'articleData.csv'
)
commentNewPd
=
pd
.
read_csv
(
'articleComments.csv'
)
articleNewPd
=
pd
.
read_csv
(
'article.csv'
)
commentNewPd
=
pd
.
read_csv
(
'comments.csv'
)
articleNewPd
.
to_sql
(
'article'
,
con
=
engine
,
if_exists
=
'replace'
,
index
=
False
)
commentNewPd
.
to_sql
(
'comments'
,
con
=
engine
,
if_exists
=
'replace'
,
index
=
False
)
os
.
remove
(
'./articleData.csv'
)
os
.
remove
(
'./articleComments.csv'
)
os
.
remove
(
'./article.csv'
)
os
.
remove
(
'./comments.csv'
)
if
__name__
==
'__main__'
:
save_to_sql
()
\ No newline at end of file
...
...
Please
register
or
login
to post a comment