diff --git a/spider/__pycache__/saveData.cpython-38.pyc b/spider/__pycache__/saveData.cpython-38.pyc deleted file mode 100644 index 97fee39..0000000 Binary files a/spider/__pycache__/saveData.cpython-38.pyc and /dev/null differ diff --git a/spider/__pycache__/spiderComments.cpython-38.pyc b/spider/__pycache__/spiderComments.cpython-38.pyc deleted file mode 100644 index e8d0ed2..0000000 Binary files a/spider/__pycache__/spiderComments.cpython-38.pyc and /dev/null differ diff --git a/spider/__pycache__/spiderContent.cpython-38.pyc b/spider/__pycache__/spiderContent.cpython-38.pyc deleted file mode 100644 index 53bfe03..0000000 Binary files a/spider/__pycache__/spiderContent.cpython-38.pyc and /dev/null differ diff --git a/spider/__pycache__/spiderData.cpython-38.pyc b/spider/__pycache__/spiderData.cpython-38.pyc deleted file mode 100644 index 254127d..0000000 Binary files a/spider/__pycache__/spiderData.cpython-38.pyc and /dev/null differ diff --git a/spider/article.csv b/spider/article.csv new file mode 100644 index 0000000..a481b83 --- /dev/null +++ b/spider/article.csv @@ -0,0 +1 @@ +id,likeNum,commentsLen,reposts_count,region,content,contentLen,created_at,type,detailUrl,authorAvatar,authorName,authorDetail,isVip diff --git a/spider/saveData.py b/spider/saveData.py index e688541..523bc9c 100644 --- a/spider/saveData.py +++ b/spider/saveData.py @@ -7,9 +7,9 @@ engine = create_engine('mysql+pymysql://XiaoXueQi:XiaoXueQi@10.92.35.13/Weibo_Pu def save_to_sql(): try: artileOldPd = pd.read_sql('select * from article',engine) - articleNewPd = pd.read_csv('articleData.csv') + articleNewPd = pd.read_csv('article.csv') commentOldPd = pd.read_sql('select * from comments',engine) - commentNewPd = pd.read_csv('articleComments.csv') + commentNewPd = pd.read_csv('comments.csv') concatArticlePd = pd.concat([articleNewPd,artileOldPd],join='inner') concatCommentsPd = pd.concat([commentNewPd,commentOldPd],join='inner')