How to convert the encoding of utf-8 into a normal string in python3

when writing python crawler (python3), the string obtained in the web page is encoded by utf-8:
clipboard.png
how to convert these utf-8 encodings into intelligible strings?

I have thought about using the decode function, but only the bytes type can call the decode function, and the string of codes I have here is actually of type string.

for example:

-sharp
mystery = b"\xe5\x88\xab"
x = mystery.decode("utf-8")
-sharp
mystery = "\xe5\x88\xab"
x = mystery.decode("utf-8")

should the crawler get r "xe5x88xab" from the web page?

data = b''

that is, include all your data in baked'. If line wrapping is involved, please use Python to handle it yourself.

Menu