Li Yatao: share three encoding conversion methods for python to Chinese
Today while fetching html code for a web page using python's xpath, there was an encoding problem with the output, as follows.
Of course, it worked out fine., I've often encountered similar problems before,python When printing the results, There are times when&# The beginning of the dong, There are times when it will appearu perhapsx opening phrase, There are times when% opening phrase
I believe you will often encounter, many friends are very distressed, today I will share the common 4 for Chinese method of unified collation, I hope it will be helpful to you.
I have compiled the following 3 codes.
Code 1: