Good evening.
I would like to know how to get rid of this error.

itemDesc.replace(';', '') 

An error occurs in this line, this variable contains html code. An error occurs:

TypeError: 'NoneType' object is not callable

    2 answers 2

    You have to believe Python. Your itemDesc object is of type NoneType . There is no replace method for it. You write that the html code is in the variable, but apparently it is not. Check the type and act depending on the result.

     >>> type(itemDesc) 

    http://docs.python.org/library/types.html#types.NoneType

    http://docs.python.org/library/string.html#string.replace

      Already figured out, I realized that you need to declare a variable as a string, but for some reason this option did not work

       itemDesc = str(itemDesc) 

      Prompted like this:

       itemDesc = itemDesc.__str__().replace('', '')<br> 

      It worked.