Answer the question
In order to leave comments, you need to log in
TypeError: 'NoneType' object is not callable why does it occur?
running python code
for el in html.select("#d_clip_button > span"):
msg.attach(MIMEText(el, 'plain'))
el = el.translate({ord(i): None for i in '<span>, /'})
print(el)
el = el.translate({ord(i): None for i in ', /'})
TypeError: 'NoneType' object is not callable
Answer the question
In order to leave comments, you need to log in
What's a parser?
The elements selected by select() are not strings, but objects of the bs4.element.Tag class with complex internal behavior. In particular, they intercept access to attributes through a dot and return None for non-existent attributes. They don't have a translate attribute/method.
What did you want to do in general?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question