The reason for this problem (wrong \ xa0) of: UTF-8 encoded web page source code is: \ xc2 \ xa0, after the adoption, converted to Unicode characters: \ xa0, when displaying the time on the DOS window, converted to GBK encoded string,
but \ xa0 this Unicode character no corresponding GBK encoded string, so the error.
Original code: S = the BeautifulSoup (r.text, 'html.parser') modified: . S = the BeautifulSoup (r.text, 'html.parser') encode ( 'UTF-. 8')