title: How to decode html string from windows-1252 using python 3
body: <p>I am trying to extract some web page contents (web scraping) using python 3. I have met with one html web page with the following sample string;</p>
  
  <pre><code>&lt;!sh6dnzerw9bef91nf0n2p6drlmxdadeulbyz24ho3kt kkoqb3jrzn b1xg21mndpb4h7cw0og1zrffu9qbz5b2w09psl3x16r 3uwu93myls56s&gt;
  </code></pre>
  
  <p>I used the following statements to identify the format and decode correspondingly;</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  
  url='xxxxxx'
  webpage=requests.get(url, verify=False)
  soup= BeautifulSoup(webpage.content, 'html.parser')
  
  if soup.original_encoding=='utf-8':
      content=str(webpage.content, 'utf-8')
  if soup.original_encoding=='cp1252':
      content=str(webpage.content, 'cp1252')
  if soup.original_encoding=='windows-1252':
      content=str(webpage.content, 'windows-1252')
  if soup.original_encoding=='ISO-8859-1':
      content=str(webpage.content, 'ISO-8859-1')
  
  print(content)
  </code></pre>
  
  <p>If I print "soup.original_encoding", it returns "windows-1252". However, the statement "print(content)" displays the web page in the same encoded format (as of the sample string above). Please, any suggestion on how I can do the conversion to the readable format.</p>