爬虫提交form表单中含有(unable to decode value)解决方法

在一次抓取网站的过程当中,使用chrome调试时,发现一个参数为:(unable to decode value),通过多方尝试,发现是网页编码问题,在返回的网页源代码中能够看到该网站编码为GBK,html

content="text/html;charset=GBK"

这里只须要使用python的encode方法将编码转换便可python

company_name = "科技有限公司"
 company_name = company_name.encode("GBK")
相关文章
相关标签/搜索