response = requests . get ( url , headers = header ) soup = BeautifulSoup ( response . content , 'html.parser' )
import sys import locale print ( sys . getfilesystemencoding ( ) ) print ( locale . getpreferredencoding ( ) )
soup = BeautifulSoup ( response . content , 'html.parser' , from_encoding = 'utf-8' )
import locale locale . setlocale ( locale . LC_ALL , 'ru_RU.UTF-8' )
print ( response . headers [ 'Content-Type' ] )