I have tried to figure out how can I get html information (such as
The reason for developing this in such a particular way is because I'm trying to make a program that will take control of user's default browser to make some repetitive tasks, and such automated process must be done using the default browser because it will have the Metamask extension that has been previously installed by the user.
May I know any ways of solving this problem?
h1 tags) from a new tab in my default browser that was opened with the following program: import tkinter as tk
#from tkinter import filedialog
import webbrowser
from bs4 import BeautifulSoup
root = tk.Tk() #create a GUI element
root.geometry('500x400') #resolution
root.title("Bulkdozer") #Name of this program
root.attributes('-topmost', True) #keep the program's window top-most
def open_chrome_profile():
soup = BeautifulSoup(webbrowser.open_new_tab('https://opensea.io/asset/create'), 'html.parser') #open a new tab using user's default browser
content = soup.find('h1', {"class": "Blockreact__Block-sc-1xf18x6-0 Textreact__Text-sc-1w94ul3-0 dBFmez llcnwK"})
print(content)
#####BUTTON ZONE#######
open_browser = tk.Button(root, width=20, text="Open OpenSea Tab", command=open_chrome_profile) #executes the function when clicked
open_browser.grid(row=22, column=1)
#####BUTTON ZONE END#######
root.mainloop()The program above does open the corresponding tab, but also throws the following error at the line of soup variable:Output:TypeError: object of type 'bool' has no len()And it doesn't print the content variable.The reason for developing this in such a particular way is because I'm trying to make a program that will take control of user's default browser to make some repetitive tasks, and such automated process must be done using the default browser because it will have the Metamask extension that has been previously installed by the user.
May I know any ways of solving this problem?
