How does python3 handle exceptions like strings?

In [50]: response.encoding
Out [50]: "utf-8"
I want to collect some information of Zhihu for analysis. In the response returned by the request, The string text is in this messy format:
"sKE" ("C" I=x00x1a) x0b "uf3d0an" x7f "{7x15" x07 "x05yI" x18G "x1cx1e1" d "Bi" o "m} R" x188x0fr2 "x1c*x12Mx01W"m"L"sKE" N "H" 3 "x14X", / 3w / x06f | W@ / x06f / w / lw / 9 / x1a_t / 3k / 0O1 > Oo / s / Z / x1a? / Oo / 2j / PdW3f / h |\ x05 / x12\ x11-YD} k\ r.\ x08 = T / T / E / h = "T" + "] KS} k\ r.\ x05"\ x12\ x11-"\ x02" >\ r.\ x08 "=" T "+"] YD} "k\ h |\ x05"\ x12\ x11-"\ x02" >\ r.\ x08 "=" T "+"] "\ x15" ~ "L\ x01U, \ x1e "oD"\ x0b3-"V" Y "a" |; \ x7f / x7f:t / < / X1c / X1e / P / X1b / N / x1a / P. / Q / 8 / x0c / Q / 8 / x0c) Qp. / 7f / v / X000 / x00 / r / v / v / X000 / X00 / r / v5 / {E / n / n / v / v / x000 / x00 / r / v / v / X000 / X00 / r / v / n / n / v / X000 / X00 / r / v / v / n / n / n ] "mu/f" OB {* "3Q" B\ rW1 "\ x18h" _ "Fg" m "zf:Yp" pa\ x0f "8\ tW" r "\" ~ "g" / y "\ n" Q "G"-"z"\ X1b < "o"\ X1b > m\ X0e) "z"\ x19 "\ x15" _ o "\ x1b}" yv "z"\ x03 \ x12\ x0f\ x16 "5" ~ "V7"! "Q\ x13" (H "2"C" rA/\ x03j = "",) "9" < "\ x11" / "* @" K "Q7," \ U00104e38 / g / y /% t / m {/ rZ / x04 / x04 / Y) BPRD / x02 / $\ x06 / r / 9 / 9e m / bs9 / 3r / x14 / x0c / v / x05 / f / B / n / x01 / x05^ 2; BbCVF\ x10 / s / o / XL (R (\ x1a$ syne / 3r / XI\ x15 / w / H / 11 / Kl / PB / x04 / x02g / x1a / x05 / P / x12rdAH / 0 / 0 / b / n / J / x1a1E / x0bJd (eT) CE. + u / 3 / x06T / k / x1fLp / 2 / x05 (J / J / yP / x15 / x12 / R / H7KV / r / JE.! / Rd\"s} n / g2$ / Q / B / n) 4K / g / g / x07c / /-sharp / r\ x0e\ x1f / i4: 0\ x17 -\ x0c\ x0f / F\ x12\ x11 < v\ x14 / x1c / 2 "9*4w3\ x05"! YB6K / tE / F / x12 / x11 < / v / x14 / x1c / 2 / x05 / v / x14 / x1c / 2 / x05c / v / x14 / x1c / 2 / x05c / v / x14X / v / x14 / x1c / 2 / x05c / v / x14 / x1c / 2 / x05?! YB6K / tE E / Zh / Vp / (/ \ x11f / V / J / e / 8A / nQ / X0e / FqIn / 6 / N / V / 8 / Z / L + / X1b / n / n / MH / 5 / 3 / n0 / Zl / MH / 5 / 3 / n0 / 5 / 3 / n0 QD5 "EH" A ("2B%"\ x124 "^"\ x13 "K" A "8"7"7"\ x16 "\ x08"\ x12\ x073d"f"\ x02 "[)"! ""\ X02 "" daM "" ([5g "8" (qM

) "
Mar.07,2021

use beautifulsoup


your io stream is in gbk format and needs to be changed to utf8


http://www.360doc.com/content.


is the request header. The way to accept it is to compress the content and remove it. Thank you, netizens.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35d8f-2bfd5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35d8f-2bfd5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?