import urllib.request import json url = "https://tinhuykhanhhoa.vn/VanBan/Detail/227" req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'}) try: html = urllib.request.urlopen(req).read().decode('utf-8') print("Success") except Exception as e: print('Error:', e)