Very tricky question with, going by the US courts, a leaning toward it being a bad idea.
But, it all depends on what you are scraping (facts vs data), how you are scraping it (have accessed a private page) and how much harm you are doing to the affected party and how you intend to use.
Reselling the information or using it in some competitive way against the owner of the data would almost certainly get you in trouble.
Writing a screen scraper just to prove you can... no real harm in that. You can read the web page after all.
N.b. I'm have no legal background or qualifications, just so we're clear.
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: