user3011030
user3011030

Reputation:

Connection to Webpage and Tkinter

I'm trying to create an application with tkinter, and I want the ability to connect it to a website and display what's there. It's sort of a web browser without the URL bar. Is it possible? If so, is there any documentation I could use? Do you have any source code I could learn from?

Upvotes: 0

Views: 1389

Answers (2)

dennis githinji
dennis githinji

Reputation: 11

I think the only way you can achieve the requirement is by creating a web page first with a url, and then connecting it to a tkinter widget.

for example:

from tkinter import *
import webbrowser

root = Tk()

new = 1
url = "https://www.google.com"

def openweb():
    webbrowser.open(url,new=new)

Btn = Button(root, text = "This opens Google",command=openweb)
Btn.pack()

root.mainloop()

Upvotes: 1

Bryan Oakley
Bryan Oakley

Reputation: 386010

There is no tkinter widget for displaying the contents of a web page.

Upvotes: 0

Related Questions