ps_filewritepagegetContents执行这段代码时报错:TypeError a bytes-like object is required not EncodedStreamObject
这个错误是因为getContents()方法返回的是一个EncodedStreamObject对象,而不是字节对象。您可以使用decode方法将其转换为字节对象,然后将其写入文件中。例如:
ps_file.write(page.getContents().decode('utf-8'))
原文地址: https://www.cveoy.top/t/topic/braC 著作权归作者所有。请勿转载和采集!