I just coded this:
import textract
text = textract.process('text.pdf')
text = text.replace('\n', '<br>')
print(text)
and I got an error because process does not return a real str object.
Traceback (most recent call last):
File "grab.py", line 4, in <module>
text = text.replace('\n', '<br>')
TypeError: a bytes-like object is required, not 'str'
But, isn't the error message wrong? Shouldn't it say the reverse like a str object is required, not bytes ?
this is python 3.6.9