I am trying to build a simple web browser with Tkinter. I would like to know how I can open a website in Tkinter/Python.
You cannot easily do what you want. Tkinter has no way to render html. You would have to parse the HTML and CSS and Javascript yourself, and translate the information for display on a canvas or text widget.
If all you want to handle is paragraphs, bold, italic, and headings, it might not be too hard. To render most real-world html with css and javascript would likely take you thousands of hours of work to get right.
At one point there was an effort to create a tkinter html widget, but that project hasn't seen any significant activity in years (http://tkhtml.tcl.tk/), and as far as I know was never integrated with Tkinter. It showed a lot of promise, but it also showed that rendering HTML is a very, very difficult task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With