【发布时间】:2017-08-13 12:21:40
【问题描述】:
当我调用以下函数时
def get_words(self):
blocks = self.soup.find_all("block", {"blockType": lambda x: x not in ('Separator', 'SeparatorsBox')})
wrds_blcks = []
for i, block in enumerate(blocks):
if block['blockType'] == 'Table':
rslt = self._get_words_from_block_table(block)
else:
rslt = self._get_words_from_block_text(block)
rslt = self._cleanup_word(rslt)
if rslt != [[]] and rslt != []:
wrds_blcks.append(rslt)
return wrds_blcks
我得到以下错误
in get_words
blocks = self.soup.find_all("block", {"blockType": lambda x: x not in ('Separator', 'SeparatorsBox')})
AttributeError: 'AbbyExtractor' object has no attribute 'soup'
参考第一行:
blocks = self.soup.find_all("block", {"blockType": lambda x: x not in ('Separator', 'SeparatorsBox')})
怎么了?
【问题讨论】:
标签: beautifulsoup python-3.5 bs4