write() argument must be str, not bytes // a bytes-like object is required, not 'method

本人也在剛開始學習爬蟲,出現了這個我問題,(write() argument must be str, not bytes),這裏你自己看下在打開文件並寫文件時,用的‘w’,還是’wb’,避免以上錯誤,需要在字符串前增加b將str轉換爲bytes,你就會發現自己的小問題了, 還有一種問題,a bytes-like object is required, not ‘method’,這種問題很神奇,你
相關文章
相關標籤/搜索