Catch an error : 'NoneType' object has no attribute 'find'