Python Forum
Which codec can help me decode the html source?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Which codec can help me decode the html source?
#1
I want to show a web page(actually a google map) in tkinter
Error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 12619: invalid start byte
import urllib.request
from tk_html_widgets import HTMLLabel
from tkinter import *
root = tk.Tk()
text = HTMLLabel(root)
text.pack(fill="both", expand=True)
text.set_html(urllib.request.urlopen("https://www.google.com" ).read().decode("UTF-8"))
text.fit_height()
root.mainloop()
Reply


Messages In This Thread
Which codec can help me decode the html source? - by vivekagrey - Jan-09-2020, 05:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 16: invalid cont Melcu54 3 5,031 Mar-26-2023, 12:12 PM
Last Post: Gribouillis
  Decode string ? JohnnyCoffee 1 833 Jan-11-2023, 12:29 AM
Last Post: bowlofred
  Tkinterweb (Browser Module) Appending/Adding Additional HTML to a HTML Table Row AaronCatolico1 0 939 Dec-25-2022, 06:28 PM
Last Post: AaronCatolico1
  [SOLVED] [Debian] UnicodeEncodeError: 'ascii' codec Winfried 1 1,037 Nov-16-2022, 11:41 AM
Last Post: Winfried
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 34: character Melcu54 7 19,080 Sep-26-2022, 10:09 AM
Last Post: Melcu54
  ASCII-Codec in Python3 [SOLVED] AlphaInc 4 6,178 Jul-07-2021, 07:05 PM
Last Post: AlphaInc
  reading html and edit chekcbox to html jacklee26 5 3,096 Jul-01-2021, 10:31 AM
Last Post: snippsat
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 error from Mysql call AkaAndrew123 1 3,468 Apr-28-2021, 08:16 AM
Last Post: AkaAndrew123
  codec for byte transparency Skaperen 7 3,873 Sep-25-2020, 02:20 AM
Last Post: Skaperen
  'utf-8' codec can't decode byte 0xe2 in position 122031: invalid continuation byte tienttt 12 11,618 Sep-18-2020, 10:10 PM
Last Post: tienttt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020