I don't understand what is wrong with this code it keeps saying:
AttributeError: 'NoneType' object has no attribute 'get'
Code:
# initial variables
from tkinter import *
import tkinter as tk
import webbrowser
window = Tk()
new = 1
url = 'https://www.youtube.com/watch?v=wb2yOsgEJJg'
window.title("Youtube link dowloader")
window.geometry('1920x1080')
# title setup
title = Label(window,text = 'Youtube Video Downloader', ).pack()
title.grid(column=0, row=0)
# Textbox
searchbar = Entry(window,width=10).pack()
searchbar.grid(column=0, row=0)
# Function to open the link in a browser
def openweb():
url = searchbar.get()
webbrowser.open(url,new=new)
# button setup
btn = Button(window, text = 'click this button to go to converter', height = 10,width = 50,
command=openweb).pack()
btn.grid(column=0, row=3)
window.mainloop()