Cannot parse the unexpected character \“\\u21B5\“ 解决方法
时间:2023-01-13 01:30:00
这种情况通常发生在request.post提交data格式问题的数据
原代码:
data={
'operationName': "visionSearchPhoto", 'query': "fragment photoContent on PhotoEntity {? id? duration? caption? likeCount? viewCount? realLikeCount? coverUrl? photoUrl? photoH265Url? manifest? manifestH265? videoResource? coverUrls {? url? __typename? }? timestamp? expTag? animatedCoverUrl? distance? videoRatio? liked? stereoType? profileUserTopPhoto? __typename?}??}?}?"
将data里面的‘?’改为‘?’\n’即可
data={
'operationName': "visionSearchPhoto", 'query': "fragment photoContent on PhotoEntity {\n id\n duration\n caption\n likeCount\n viewCount\n realLikeCount\n coverUrl\n photoUrl\n photoH265Url\n manifest\n manifestH265\n videoResource\n coverUrls {\n url\n __typename\n }\n timestamp\n expTag\n animatedCoverUrl\n distance\n videoRatio\n liked\n stereoType\n profileUserTopPhoto\n __typename\n}\n\n}\n}\n"
成功解决错误
参考文章:https://stackoverflow.com/questions/64265661/graphql-query-post-with-python-request