首页 > 其他 > 详细

Post页面爬取失败__编码问题

时间:2018-06-04 17:29:42      阅读:181      评论:0      收藏:0      [点我收藏+]

python3爬取Post页面时, 报以下错误

技术分享图片

 

"POST data should be bytes or an iterable of bytes. It cannot be of type str."

技术分享图片

解决方案:

需要在urlencode语句后加encode(encoding=‘UTF8‘)

data = urllib.parse.urlencode(values).encode(encoding=‘UTF8‘)

  

 

Post页面爬取失败__编码问题

原文:https://www.cnblogs.com/amou/p/9134425.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!