import requests

def user_guide():
    r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
    return r.text, r.status_code


import requests

def user_guide():
    r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
    r.encoding = r.apparent_encoding
    return r.text, r.status_code


Set response encoding based on apparent_encoding.
Set response encoding based on apparent_encoding.

Headers from drweeaboo.net incorrectly tell us ISO-8859-1.

  import requests
  
  def user_guide():
      r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
+     r.encoding = r.apparent_encoding
      return r.text, r.status_code
  
  
Set response encoding based on apparent_encoding.
## Code Before:
import requests

def user_guide():
    r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
    return r.text, r.status_code


## Instruction:
Set response encoding based on apparent_encoding.
## Code After:
import requests

def user_guide():
    r = requests.get("http://drweeaboo.net/msparp/userguide/duplicateguide.html")
    r.encoding = r.apparent_encoding
    return r.text, r.status_code

