6
for comment_entry in comment_feed.entry:
content = comment_entry.ToString()
parse = BeautifulSoup(content)
for con in parse.find('ns0:content'):
print con.string
s = con.string
file.write(s.encode('utf8'))
錯誤,我越來越:如何解決AttributeError的: 'NoneType' 對象在Python中沒有屬性 '編碼'
File "channel_search.py", line 108, in youtube_search
file.write(s.encode('utf8'))
AttributeError: 'NoneType' object has no attribute 'encode'
什麼打印con.string給你 – 2014-09-22 06:44:16