class myspider ( base.spiderFrame ):
def spider(max_num,url,road):
for page_num in range(1,max_num):
html='url'+'&page'+'=%d'%(page_num)
page=urllib.request.urlopen(html)
soup=BeautifulSoup(page,"lxml")
……
def click_event( self, event ):
url=self.urltxt.GetValue()
max_num=self.page_num.GetValue()
road=self.roadtxt.GetPath()
spider(max_num,url,road)
代码如上,一直提示spider这个函数未定义?