SiLaure's Data
[ToyPrj-Crawling] CGV 리뷰 크롤링 하기(3) 본문
아직까지는 배운 내용으로 어떻게든 해보고 있음.
저 \를 없애려고 노력했다...
참고한 사이트 : https://eunjin3786.tistory.com/149
In [1]:
import requests
import json
import bs4
In [8]:
page_num = 1
movie_num = 84775
url = f'http://www.cgv.co.kr/movies/detail-view/?midx={movie_num}#{page_num}'
param = "{\"TotalCount\":14509,\"List\":[{\"CommentIdx\":31525436,\"CommentTypeCode\":524,\"Point\":0,\"CommentText\":\"너무너무\\n재밌어요 잘봤어요\",\"UserID\":\"mth0105\",\"RegistUser\":\"민태홍\",\"NickName\":null,\"UserImage\":\"\",\"UserSmallImage\":\"\",\"RegistDate\":\"2021.08.02\",\"EggPoint\":2,\"IsVIP\":\"N\",\"PollCharming\":\"N\",\"Acting\":null,\"Story\":null,\"Visual\":null,\"OST\":null,\"Effect\":null,\"MediaTypeCode\":\"411^\",\"UserIdNicName\":\"mt**105\",\"IsMine\":false,\"IsViewer\":true,\"IsShowView\":true,\"IsNormal\":false,\"IsMobile\":true,\"MovieIdx\":84775,\"MovieTitle\":\"\",\"MovieGrade\":{\"Idx\":919,\"GradeText\":\"미정\",\"StyleClassName\":\"grade-none\"},\"PosterImage\":{\"ThumbNailImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg\",\"SmallImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg\",\"MiddleImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg\",\"LargeImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg\",\"OrgImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg\"},\"IsMyGOOD\":false,\"GOODCNT\":0,\"IsMySPOILER\":false,\"SPOILERCNT\":0,\"IsMyREPORT\":false,\"REPORTCNT\":0,\"withviewcnt\":0,\"withviewer\":\"\",\"Genre_SMS1\":null,\"EmotionYN\":null,\"Emotion1\":null,\"Emotion1Text\":null,\"Emotion2\":null,\"Emotion2Text\":null,\"Emotion3\":null,\"Emotion3Text\":null,\"Emotion4\":null,\"Emotion4Text\":null,\"Emotion5\":null,\"Emotion5Text\":null},{\"CommentIdx\":31525434,\"CommentTypeCode\":524,\"Point\":0,\"CommentText\":\"예상했던 그 대로임. 해외올로케라서 현장감은 있었습니다\",\"UserID\":\"yoonjcho777\",\"RegistUser\":\"조윤주\",\"NickName\":null,\"UserImage\":\"\",\"UserSmallImage\":\"\",\"RegistDate\":\"2021.08.02\",\"EggPoint\":2,\"IsVIP\":\"Y\",\"PollCharming\":\"N\",\"Acting\":null,\"Story\":null,\"Visual\":null,\"OST\":null,\"Effect\":null,\"MediaTypeCode\":\"411^\",\"UserIdNicName\":\"썬롸이주\",\"IsMine\":false,\"IsViewer\":true,\"IsShowView\":true,\"IsNormal\":false,\"IsMobile\":true,\"MovieIdx\":84775,\"MovieTitle\":\"\",\"MovieGrade\":{\"Idx\":919,\"GradeText\":\"미정\",\"StyleClassName\":\"grade-none\"},\"PosterImage\":{\"ThumbNailImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg\",\"SmallImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg\",\"MiddleImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg\",\"LargeImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg\",\"OrgImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg\"},\"IsMyGOOD\":false,\"GOODCNT\":0,\"IsMySPOILER\":false,\"SPOILERCNT\":0,\"IsMyREPORT\":false,\"REPORTCNT\":0,\"withviewcnt\":0,\"withviewer\":\"\",\"Genre_SMS1\":null,\"EmotionYN\":null,\"Emotion1\":null,\"Emotion1Text\":null,\"Emotion2\":null,\"Emotion2Text\":null,\"Emotion3\":null,\"Emotion3Text\":null,\"Emotion4\":null,\"Emotion4Text\":null,\"Emotion5\":null,\"Emotion5Text\":null},{\"CommentIdx\":31525433,\"CommentTypeCode\":524,\"Point\":0,\"CommentText\":\"옳고 그름을 떠나 아이들에게 총 쥐어주는 집단은 나쁜 넘이다.\",\"UserID\":\"kgsdragon\",\"RegistUser\":\"김강섭\",\"NickName\":null,\"UserImage\":\"https://img.cgv.co.kr/MyCGV/Profile/2018/0118/kgsdragon_080401_M.jpg\",\"UserSmallImage\":\"https://img.cgv.co.kr/MyCGV/Profile/2018/0118/kgsdragon_080401_M.jpg\",\"RegistDate\":\"2021.08.02\",\"EggPoint\":2,\"IsVIP\":\"Y\",\"PollCharming\":\"N\",\"Acting\":null,\"Story\":null,\"Visual\":null,\"OST\":null,\"Effect\":null,\"MediaTypeCode\":\"411^\",\"UserIdNicName\":\"가을햇볕\",\"IsMine\":false,\"IsViewer\":true,\"IsShowView\":true,\"IsNormal\":false,\"IsMobile\":true,\"MovieIdx\":84775,\"MovieTitle\":\"\",\"MovieGrade\":{\"Idx\":919,\"GradeText\":\"미정\",\"StyleClassName\":\"grade-none\"},\"PosterImage\":{\"ThumbNailImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg\",\"SmallImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg\",\"MiddleImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg\",\"LargeImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg\",\"OrgImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg\"},\"IsMyGOOD\":false,\"GOODCNT\":0,\"IsMySPOILER\":false,\"SPOILERCNT\":0,\"IsMyREPORT\":false,\"REPORTCNT\":0,\"withviewcnt\":0,\"withviewer\":\"\",\"Genre_SMS1\":null,\"EmotionYN\":null,\"Emotion1\":null,\"Emotion1Text\":null,\"Emotion2\":null,\"Emotion2Text\":null,\"Emotion3\":null,\"Emotion3Text\":null,\"Emotion4\":null,\"Emotion4Text\":null,\"Emotion5\":null,\"Emotion5Text\":null},{\"CommentIdx\":31525431,\"CommentTypeCode\":524,\"Point\":0,\"CommentText\":\"남북이 화합하는 모습이 시대적인 모습과 대비되어 잘표현되어 있는\\n것같다.\",\"UserID\":\"ysgmw862367\",\"RegistUser\":\"윤석경\",\"NickName\":null,\"UserImage\":\"https://img.cgv.co.kr/MyCGV/Profile/2018/0102/ysgmw862367_094610_M.jpg\",\"UserSmallImage\":\"https://img.cgv.co.kr/MyCGV/Profile/2018/0102/ysgmw862367_094610_M.jpg\",\"RegistDate\":\"2021.08.02\",\"EggPoint\":2,\"IsVIP\":\"Y\",\"PollCharming\":\"N\",\"Acting\":null,\"Story\":null,\"Visual\":null,\"OST\":null,\"Effect\":null,\"MediaTypeCode\":\"411^\",\"UserIdNicName\":\"타임리더\",\"IsMine\":false,\"IsViewer\":true,\"IsShowView\":true,\"IsNormal\":false,\"IsMobile\":true,\"MovieIdx\":84775,\"MovieTitle\":\"\",\"MovieGrade\":{\"Idx\":919,\"GradeText\":\"미정\",\"StyleClassName\":\"grade-none\"},\"PosterImage\":{\"ThumbNailImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg\",\"SmallImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg\",\"MiddleImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg\",\"LargeImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg\",\"OrgImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg\"},\"IsMyGOOD\":false,\"GOODCNT\":0,\"IsMySPOILER\":false,\"SPOILERCNT\":0,\"IsMyREPORT\":false,\"REPORTCNT\":0,\"withviewcnt\":0,\"withviewer\":\"\",\"Genre_SMS1\":null,\"EmotionYN\":null,\"Emotion1\":null,\"Emotion1Text\":null,\"Emotion2\":null,\"Emotion2Text\":null,\"Emotion3\":null,\"Emotion3Text\":null,\"Emotion4\":null,\"Emotion4Text\":null,\"Emotion5\":null,\"Emotion5Text\":null},{\"CommentIdx\":31525428,\"CommentTypeCode\":524,\"Point\":0,\"CommentText\":\"류승완감독 믿고보구요 배우도 믿고보니 아무생각없이봐서 올해최고의 승완감독님 다음작품도 기대합니다~\",\"UserID\":\"shboy777\",\"RegistUser\":\"shboy777\",\"NickName\":null,\"UserImage\":\"\",\"UserSmallImage\":\"\",\"RegistDate\":\"2021.08.02\",\"EggPoint\":2,\"IsVIP\":\"Y\",\"PollCharming\":\"N\",\"Acting\":null,\"Story\":null,\"Visual\":null,\"OST\":null,\"Effect\":null,\"MediaTypeCode\":\"411^\",\"UserIdNicName\":\"sh**y777\",\"IsMine\":false,\"IsViewer\":true,\"IsShowView\":true,\"IsNormal\":false,\"IsMobile\":false,\"MovieIdx\":84775,\"MovieTitle\":\"\",\"MovieGrade\":{\"Idx\":919,\"GradeText\":\"미정\",\"StyleClassName\":\"grade-none\"},\"PosterImage\":{\"ThumbNailImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg\",\"SmallImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg\",\"MiddleImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg\",\"LargeImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg\",\"OrgImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg\"},\"IsMyGOOD\":false,\"GOODCNT\":1,\"IsMySPOILER\":false,\"SPOILERCNT\":0,\"IsMyREPORT\":false,\"REPORTCNT\":0,\"withviewcnt\":0,\"withviewer\":\"\",\"Genre_SMS1\":null,\"EmotionYN\":null,\"Emotion1\":null,\"Emotion1Text\":null,\"Emotion2\":null,\"Emotion2Text\":null,\"Emotion3\":null,\"Emotion3Text\":null,\"Emotion4\":null,\"Emotion4Text\":null,\"Emotion5\":null,\"Emotion5Text\":null},{\"CommentIdx\":31525427,\"CommentTypeCode\":524,\"Point\":0,\"CommentText\":\"볼만하고 나라를 생각하게 하고 먼가 생각하게 하는 영화\\n\",\"UserID\":\"windbell79\",\"RegistUser\":\"변수현\",\"NickName\":null,\"UserImage\":\"https://img.cgv.co.kr/MyCGV/Profile/2017/0519/windbell79_013621_M.jpg\",\"UserSmallImage\":\"https://img.cgv.co.kr/MyCGV/Profile/2017/0519/windbell79_013621_M.jpg\",\"RegistDate\":\"2021.08.02\",\"EggPoint\":2,\"IsVIP\":\"N\",\"PollCharming\":\"N\",\"Acting\":null,\"Story\":null,\"Visual\":null,\"OST\":null,\"Effect\":null,\"MediaTypeCode\":\"411^\",\"UserIdNicName\":\"보라루핀\",\"IsMine\":false,\"IsViewer\":true,\"IsShowView\":true,\"IsNormal\":false,\"IsMobile\":true,\"MovieIdx\":84775,\"MovieTitle\":\"\",\"MovieGrade\":{\"Idx\":919,\"GradeText\":\"미정\",\"StyleClassName\":\"grade-none\"},\"PosterImage\":{\"ThumbNailImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg\",\"SmallImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg\",\"MiddleImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg\",\"LargeImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg\",\"OrgImage\":\"https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg\"},\"IsMyGOOD\":false,\"GOODCNT\":0,\"IsMySPOILER\":false,\"SPOILERCNT\":0,\"IsMyREPORT\":false,\"REPORTCNT\":0,\"withviewcnt\":0,\"withviewer\":\"\",\"Genre_SMS1\":null,\"EmotionYN\":null,\"Emotion1\":null,\"Emotion1Text\":null,\"Emotion2\":null,\"Emotion2Text\":null,\"Emotion3\":null,\"Emotion3Text\":null,\"Emotion4\":null,\"Emotion4Text\":null,\"Emotion5\":null,\"Emotion5Text\":null}]}"
str_del = '\"'
for x in range(len(str_del)) :
param = param.replace(str_del[x], "")
param
Out[8]:
'{TotalCount:14509,List:[{CommentIdx:31525436,CommentTypeCode:524,Point:0,CommentText:너무너무\\n재밌어요 잘봤어요,UserID:mth0105,RegistUser:민태홍,NickName:null,UserImage:,UserSmallImage:,RegistDate:2021.08.02,EggPoint:2,IsVIP:N,PollCharming:N,Acting:null,Story:null,Visual:null,OST:null,Effect:null,MediaTypeCode:411^,UserIdNicName:mt**105,IsMine:false,IsViewer:true,IsShowView:true,IsNormal:false,IsMobile:true,MovieIdx:84775,MovieTitle:,MovieGrade:{Idx:919,GradeText:미정,StyleClassName:grade-none},PosterImage:{ThumbNailImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg,SmallImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg,MiddleImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg,LargeImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg,OrgImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg},IsMyGOOD:false,GOODCNT:0,IsMySPOILER:false,SPOILERCNT:0,IsMyREPORT:false,REPORTCNT:0,withviewcnt:0,withviewer:,Genre_SMS1:null,EmotionYN:null,Emotion1:null,Emotion1Text:null,Emotion2:null,Emotion2Text:null,Emotion3:null,Emotion3Text:null,Emotion4:null,Emotion4Text:null,Emotion5:null,Emotion5Text:null},{CommentIdx:31525434,CommentTypeCode:524,Point:0,CommentText:예상했던 그 대로임. 해외올로케라서 현장감은 있었습니다,UserID:yoonjcho777,RegistUser:조윤주,NickName:null,UserImage:,UserSmallImage:,RegistDate:2021.08.02,EggPoint:2,IsVIP:Y,PollCharming:N,Acting:null,Story:null,Visual:null,OST:null,Effect:null,MediaTypeCode:411^,UserIdNicName:썬롸이주,IsMine:false,IsViewer:true,IsShowView:true,IsNormal:false,IsMobile:true,MovieIdx:84775,MovieTitle:,MovieGrade:{Idx:919,GradeText:미정,StyleClassName:grade-none},PosterImage:{ThumbNailImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg,SmallImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg,MiddleImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg,LargeImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg,OrgImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg},IsMyGOOD:false,GOODCNT:0,IsMySPOILER:false,SPOILERCNT:0,IsMyREPORT:false,REPORTCNT:0,withviewcnt:0,withviewer:,Genre_SMS1:null,EmotionYN:null,Emotion1:null,Emotion1Text:null,Emotion2:null,Emotion2Text:null,Emotion3:null,Emotion3Text:null,Emotion4:null,Emotion4Text:null,Emotion5:null,Emotion5Text:null},{CommentIdx:31525433,CommentTypeCode:524,Point:0,CommentText:옳고 그름을 떠나 아이들에게 총 쥐어주는 집단은 나쁜 넘이다.,UserID:kgsdragon,RegistUser:김강섭,NickName:null,UserImage:https://img.cgv.co.kr/MyCGV/Profile/2018/0118/kgsdragon_080401_M.jpg,UserSmallImage:https://img.cgv.co.kr/MyCGV/Profile/2018/0118/kgsdragon_080401_M.jpg,RegistDate:2021.08.02,EggPoint:2,IsVIP:Y,PollCharming:N,Acting:null,Story:null,Visual:null,OST:null,Effect:null,MediaTypeCode:411^,UserIdNicName:가을햇볕,IsMine:false,IsViewer:true,IsShowView:true,IsNormal:false,IsMobile:true,MovieIdx:84775,MovieTitle:,MovieGrade:{Idx:919,GradeText:미정,StyleClassName:grade-none},PosterImage:{ThumbNailImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg,SmallImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg,MiddleImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg,LargeImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg,OrgImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg},IsMyGOOD:false,GOODCNT:0,IsMySPOILER:false,SPOILERCNT:0,IsMyREPORT:false,REPORTCNT:0,withviewcnt:0,withviewer:,Genre_SMS1:null,EmotionYN:null,Emotion1:null,Emotion1Text:null,Emotion2:null,Emotion2Text:null,Emotion3:null,Emotion3Text:null,Emotion4:null,Emotion4Text:null,Emotion5:null,Emotion5Text:null},{CommentIdx:31525431,CommentTypeCode:524,Point:0,CommentText:남북이 화합하는 모습이 시대적인 모습과 대비되어 잘표현되어 있는\\n것같다.,UserID:ysgmw862367,RegistUser:윤석경,NickName:null,UserImage:https://img.cgv.co.kr/MyCGV/Profile/2018/0102/ysgmw862367_094610_M.jpg,UserSmallImage:https://img.cgv.co.kr/MyCGV/Profile/2018/0102/ysgmw862367_094610_M.jpg,RegistDate:2021.08.02,EggPoint:2,IsVIP:Y,PollCharming:N,Acting:null,Story:null,Visual:null,OST:null,Effect:null,MediaTypeCode:411^,UserIdNicName:타임리더,IsMine:false,IsViewer:true,IsShowView:true,IsNormal:false,IsMobile:true,MovieIdx:84775,MovieTitle:,MovieGrade:{Idx:919,GradeText:미정,StyleClassName:grade-none},PosterImage:{ThumbNailImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg,SmallImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg,MiddleImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg,LargeImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg,OrgImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg},IsMyGOOD:false,GOODCNT:0,IsMySPOILER:false,SPOILERCNT:0,IsMyREPORT:false,REPORTCNT:0,withviewcnt:0,withviewer:,Genre_SMS1:null,EmotionYN:null,Emotion1:null,Emotion1Text:null,Emotion2:null,Emotion2Text:null,Emotion3:null,Emotion3Text:null,Emotion4:null,Emotion4Text:null,Emotion5:null,Emotion5Text:null},{CommentIdx:31525428,CommentTypeCode:524,Point:0,CommentText:류승완감독 믿고보구요 배우도 믿고보니 아무생각없이봐서 올해최고의 승완감독님 다음작품도 기대합니다~,UserID:shboy777,RegistUser:shboy777,NickName:null,UserImage:,UserSmallImage:,RegistDate:2021.08.02,EggPoint:2,IsVIP:Y,PollCharming:N,Acting:null,Story:null,Visual:null,OST:null,Effect:null,MediaTypeCode:411^,UserIdNicName:sh**y777,IsMine:false,IsViewer:true,IsShowView:true,IsNormal:false,IsMobile:false,MovieIdx:84775,MovieTitle:,MovieGrade:{Idx:919,GradeText:미정,StyleClassName:grade-none},PosterImage:{ThumbNailImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg,SmallImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg,MiddleImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg,LargeImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg,OrgImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg},IsMyGOOD:false,GOODCNT:1,IsMySPOILER:false,SPOILERCNT:0,IsMyREPORT:false,REPORTCNT:0,withviewcnt:0,withviewer:,Genre_SMS1:null,EmotionYN:null,Emotion1:null,Emotion1Text:null,Emotion2:null,Emotion2Text:null,Emotion3:null,Emotion3Text:null,Emotion4:null,Emotion4Text:null,Emotion5:null,Emotion5Text:null},{CommentIdx:31525427,CommentTypeCode:524,Point:0,CommentText:볼만하고 나라를 생각하게 하고 먼가 생각하게 하는 영화\\n,UserID:windbell79,RegistUser:변수현,NickName:null,UserImage:https://img.cgv.co.kr/MyCGV/Profile/2017/0519/windbell79_013621_M.jpg,UserSmallImage:https://img.cgv.co.kr/MyCGV/Profile/2017/0519/windbell79_013621_M.jpg,RegistDate:2021.08.02,EggPoint:2,IsVIP:N,PollCharming:N,Acting:null,Story:null,Visual:null,OST:null,Effect:null,MediaTypeCode:411^,UserIdNicName:보라루핀,IsMine:false,IsViewer:true,IsShowView:true,IsNormal:false,IsMobile:true,MovieIdx:84775,MovieTitle:,MovieGrade:{Idx:919,GradeText:미정,StyleClassName:grade-none},PosterImage:{ThumbNailImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_73.jpg,SmallImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_126.jpg,MiddleImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_185.jpg,LargeImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_320.jpg,OrgImage:https://img.cgv.co.kr/Movie/Thumbnail/Poster/000084/84775/84775_1000.jpg},IsMyGOOD:false,GOODCNT:0,IsMySPOILER:false,SPOILERCNT:0,IsMyREPORT:false,REPORTCNT:0,withviewcnt:0,withviewer:,Genre_SMS1:null,EmotionYN:null,Emotion1:null,Emotion1Text:null,Emotion2:null,Emotion2Text:null,Emotion3:null,Emotion3Text:null,Emotion4:null,Emotion4Text:null,Emotion5:null,Emotion5Text:null}]}'
In [17]:
# 개발자 도구에서 Form Data가 안 보여서 view source에서 긁어옴.
dict = {"CommentText" : "",
"UserIdNicName" : "",
"Date" : "",
"MovieIdx" : {movie_num},
"RegistDate" : ""}
parameters = {'param' : str(dict)}
print(dict)
{'CommentText': '', 'UserIdNicName': '', 'Date': '', 'MovieIdx': {84775}, 'RegistDate': ''}
In [19]:
# 안 됨
# response = requests.post(url, data=parameters).json()
---------------------------------------------------------------------------
UnicodeEncodeError Traceback (most recent call last)
<ipython-input-19-e34cdf6ccb53> in <module>
1 # 안 됨
----> 2 response = requests.post(url, data=param).json()
~\anaconda3\envs\datascience\lib\site-packages\requests\api.py in post(url, data, json, **kwargs)
117 """
118
--> 119 return request('post', url, data=data, json=json, **kwargs)
120
121
~\anaconda3\envs\datascience\lib\site-packages\requests\api.py in request(method, url, **kwargs)
59 # cases, and look like a memory leak in others.
60 with sessions.Session() as session:
---> 61 return session.request(method=method, url=url, **kwargs)
62
63
~\anaconda3\envs\datascience\lib\site-packages\requests\sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
540 }
541 send_kwargs.update(settings)
--> 542 resp = self.send(prep, **send_kwargs)
543
544 return resp
~\anaconda3\envs\datascience\lib\site-packages\requests\sessions.py in send(self, request, **kwargs)
653
654 # Send the request
--> 655 r = adapter.send(request, **kwargs)
656
657 # Total elapsed time of the request (approximately)
~\anaconda3\envs\datascience\lib\site-packages\requests\adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
437 try:
438 if not chunked:
--> 439 resp = conn.urlopen(
440 method=request.method,
441 url=url,
~\anaconda3\envs\datascience\lib\site-packages\urllib3\connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
697
698 # Make the request on the httplib connection object.
--> 699 httplib_response = self._make_request(
700 conn,
701 method,
~\anaconda3\envs\datascience\lib\site-packages\urllib3\connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
392 conn.request_chunked(method, url, **httplib_request_kw)
393 else:
--> 394 conn.request(method, url, **httplib_request_kw)
395
396 # We are swallowing BrokenPipeError (errno.EPIPE) since the server is
~\anaconda3\envs\datascience\lib\site-packages\urllib3\connection.py in request(self, method, url, body, headers)
232 if "user-agent" not in (six.ensure_str(k.lower()) for k in headers):
233 headers["User-Agent"] = _get_default_user_agent()
--> 234 super(HTTPConnection, self).request(method, url, body=body, headers=headers)
235
236 def request_chunked(self, method, url, body=None, headers=None):
~\anaconda3\envs\datascience\lib\http\client.py in request(self, method, url, body, headers, encode_chunked)
1253 encode_chunked=False):
1254 """Send a complete request to the server."""
-> 1255 self._send_request(method, url, body, headers, encode_chunked)
1256
1257 def _send_request(self, method, url, body, headers, encode_chunked):
~\anaconda3\envs\datascience\lib\http\client.py in _send_request(self, method, url, body, headers, encode_chunked)
1298 # RFC 2616 Section 3.7.1 says that text default has a
1299 # default charset of iso-8859-1.
-> 1300 body = _encode(body, 'body')
1301 self.endheaders(body, encode_chunked=encode_chunked)
1302
~\anaconda3\envs\datascience\lib\http\client.py in _encode(data, name)
162 return data.encode("latin-1")
163 except UnicodeEncodeError as err:
--> 164 raise UnicodeEncodeError(
165 err.encoding,
166 err.object,
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 85-88: Body ('너무너무') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.
jupyter notebook : 죽여줘...
'Records of > Projects' 카테고리의 다른 글
[EDA] Instacart Market Basket Analysis - 코드 필사(1) (0) | 2021.08.13 |
---|---|
[ToyPrj-Crawling] CGV 리뷰 크롤링 하기(final) (1) | 2021.08.03 |
[ToyPrj-Crawling] CGV 리뷰 크롤링 하기(4) (0) | 2021.08.03 |
[ToyPrj-Crawling] CGV 리뷰 크롤링 하기(2) (0) | 2021.08.03 |
[ToyPrj-Crawling] CGV 리뷰 크롤링 하기(1) (0) | 2021.08.02 |
Comments