爬蟲提交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")
相關文章
相關標籤/搜索