Python Error: TypeError: write() argument must be str, not bytes

The solution to this error when saving a downloaded page to file:

TypeError: write() argument must be str, not bytes

is:

outFile = open(‘output.xml’, ‘wb’)”b” for binary makes the difference.

20

No Responses

Write a response