标签:reset python爬虫 error 脚本 parse blog python 爬虫 round 重写
这里将会记录我在学习写【Python爬虫】脚本过程中遇到的各种各样的“问题”,希望对后来者有所帮助。
1、SGMLParser
SGMLParser 模块用于解析网页标签,使用期间遇到如下Error:
AttributeError: HtmlPars instance has no attribute ‘rawdata‘
出现的原因是【重写 Reset 函数时未调用父类 Reset】,解决方法很简单,调用一下就完事了
class HtmlPars(SGMLParser): def reset(self): SGMLParser.reset(self)
. . .
标签:reset python爬虫 error 脚本 parse blog python 爬虫 round 重写
原文地址:http://www.cnblogs.com/ooacmer/p/6217478.html