CodePudding user response:
Is the code to see your source code files, web page source file, the response set, if the print output console are unified codingCodePudding user response:
Response. Apparent_encoding # to check the web page codeYou question which should be their terminal code set is a Linux terminal?
CodePudding user response:
Windows PCS GBKCodePudding user response:
Why didn't I have the codeimport requests
Url="https://movie.douban.com/top250? Start=0 & amp; The filter='
Headers={' the user-agent ':' Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari 537.36/Core/1.70.3756.400 QQBrowser/10.5.4039.400 '}
The response=requests. Get (url=url, headers=headers)
Print (response. The text)
Results:
CodePudding user response:
Your output utf-8?CodePudding user response:
I have been to this problem, I keep only in the request header "the user-agent" : "Mozilla/5.0 (Windows NT 10.0; Win64. X64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 "this one, the output is normal,