2006年08月10日 星期四 13:25
http://www.cn">onepage 这样的html,怎么获得onepage?
2006年08月10日 星期四 13:52
def start_a(self,attrs): #print 'start_a' for attr,val in attrs: if attr=='href': self.__curAnchorLink=val self.__inA=True def handle_data(self,data): data=data.strip() if self.__inA: self.__curAnchorText+=data def end_a(self): if self.__inA: self.__anchorTexts.append((self.__curAnchorLink,self.__curAnchorText)) self.__curAnchorText='' self.__inA=False -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060810/19a5b386/attachment.html
2006年08月10日 星期四 14:22
thanks very much~~ 原来handle_data那么牛的~~ 2006/8/10, bird devdoer <devdoer at gmail.com>: > def start_a(self,attrs): > #print 'start_a' > for attr,val in attrs: > if attr=='href': > > self.__curAnchorLink=val > self.__inA=True > def handle_data(self,data): > data=data.strip() > > if self.__inA: > self.__curAnchorText+=data > def end_a(self): > if self.__inA: > > self.__anchorTexts.append((self.__curAnchorLink,self.__curAnchorText)) > self.__curAnchorText='' > self.__inA=False > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > >
Zeuux © 2025
京ICP备05028076号