天天看點

關于scrapy的to_unicode must receive a bytes, str or unicode object, got set報錯解決

scrapy的to_unicode must receive a bytes, str or unicode object, got set

架構雖然幫我們省去了很多不需要考慮的底層問題,進而提高了開發效率,但是遇到有些錯誤提示,讓人根本無從下手,筆者今天就遇到下圖這個問題,問題貌似是跟編碼問題有關,嘗試了各種辦法都沒解決

關于scrapy的to_unicode must receive a bytes, str or unicode object, got set報錯解決

最後在配置檔案裡找到了原因

關于scrapy的to_unicode must receive a bytes, str or unicode object, got set報錯解決

由于經常用requests等子產品爬去小資料,是以把這裡的代理位址加上了花括号,而我們的scrapy架構是不需要用花括号的

繼續閱讀