Showing
6 changed files
with
3 additions
and
2 deletions
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
spider/article.csv
0 → 100644
| 1 | +id,likeNum,commentsLen,reposts_count,region,content,contentLen,created_at,type,detailUrl,authorAvatar,authorName,authorDetail,isVip |
| @@ -7,9 +7,9 @@ engine = create_engine('mysql+pymysql://XiaoXueQi:XiaoXueQi@10.92.35.13/Weibo_Pu | @@ -7,9 +7,9 @@ engine = create_engine('mysql+pymysql://XiaoXueQi:XiaoXueQi@10.92.35.13/Weibo_Pu | ||
| 7 | def save_to_sql(): | 7 | def save_to_sql(): |
| 8 | try: | 8 | try: |
| 9 | artileOldPd = pd.read_sql('select * from article',engine) | 9 | artileOldPd = pd.read_sql('select * from article',engine) |
| 10 | - articleNewPd = pd.read_csv('articleData.csv') | 10 | + articleNewPd = pd.read_csv('article.csv') |
| 11 | commentOldPd = pd.read_sql('select * from comments',engine) | 11 | commentOldPd = pd.read_sql('select * from comments',engine) |
| 12 | - commentNewPd = pd.read_csv('articleComments.csv') | 12 | + commentNewPd = pd.read_csv('comments.csv') |
| 13 | 13 | ||
| 14 | concatArticlePd = pd.concat([articleNewPd,artileOldPd],join='inner') | 14 | concatArticlePd = pd.concat([articleNewPd,artileOldPd],join='inner') |
| 15 | concatCommentsPd = pd.concat([commentNewPd,commentOldPd],join='inner') | 15 | concatCommentsPd = pd.concat([commentNewPd,commentOldPd],join='inner') |
-
Please register or login to post a comment