出现®symbol崩溃空闲的问题

2024-10-03 13:24:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在为大学做一个评估,在那里我们必须用TKinter来浏览网站和显示信息。我使用的网站使用的是?符号,而不是?的HTML代码。每次我运行我的代码,空闲崩溃。我想知道有没有人知道解决这个问题的办法。在

    from urllib import urlopen
    from re import findall
    from Tkinter import *
    from HTMLParser import *

    games_window = Tk()
    games_window.title('Top 10 Games Specials')
    games_window.geometry('1000x1000')


    games_contents = urlopen("http://store.steampowered.com/search/?specials=1").read()
    gam_info = findall('<img src="([\w\.:/]*.jpg[?t=0-9]*)[a-z\s?="<>/_]*([\w\.\-\(\) \':$&!®]*)[a-z\s/<>="_]*([\w ,]*)[\w\s/<>="&-;%#]*([0-9\.$]*)[\w\s/<>]*([0-9\.$]*)',games_contents)

    info01 = Label(games_window, text = gam_info[0][1], font=("Courier", 15), relief=SUNKEN)

    info01.place(x = 230, y = 450)

    games_window.mainloop()

Tags: 代码fromimportinfo网站tkintercontents符号