Wie zu beheben AttributeError: 'NoneType' object hat keine attribute 'encode' in python

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'))

Fehler, die ich immer bin:

File "channel_search.py", line 108, in youtube_search
file.write(s.encode('utf8'))
AttributeError: 'NoneType' object has no attribute 'encode'
was bedeutet print-con.string gibt Sie

InformationsquelleAutor user3844662 | 2014-09-22

Schreibe einen Kommentar