原文:scrapy+mongodb報錯 TypeError: name must be an instance of str

經過各種排查,最后找到原因,在settings文件中配置文件大小寫寫錯了,在pipelines中 ...

2018-01-30 10:29 0 1879 推薦指數:

查看詳情

TypeError: must be str, not bytes

先說下python的版本吧 3.6 1.TypeError: must be str, not bytes錯誤: 解答: 寫文件處 open(filename, 'w').write 應該寫為 open(filename, 'wb').write 2.當文本文件里面有中文時,需要進行編碼轉換 ...

Wed Feb 03 03:56:00 CST 2021 0 666
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM