from bs4 import BeautifulSoup from urllib import request response = request.urlopen("http://memoon.mskjp.com") soup = BeautifulSoup(response.read()) #本題はここ print( soup.original_encoding )
BeautifulSoupに読み込んで、original_encodingを取得するだけ
公式ドキュメント:
Beautiful Soup Documentation — Beautiful Soup 4.2.0 documentation