AttributeError: 'NoneType' object has no attribute 'find'

遇到这个问题是因为读取excel表格的数据时默认是str类型,但是excel有空行时,类型读取为NoneType,如果把类型转换为str或者把excel里的空行删掉就不会有这个问题

AttributeError: 'NoneType' object has no attribute 'find'

原文地址:https://www.cnblogs.com/wangguniang/p/12101189.html

时间: 2024-10-11 08:50:15

AttributeError: 'NoneType' object has no attribute 'find'的相关文章

python3 AttributeError: 'NoneType' object has no attribute 'split'

1 from wsgiref.simple_server import make_server 2 3 def RunServer(environ, start_response): 4 start_response('200 ok',[('Content-Type','text/html')]) 5 return '<h1>Hello world</h1>' 6 7 if __name__ == '__main__': 8 httpd = make_server('127.0.0

如何解决CRITICAL glance [-] AttributeError: &#39;NoneType&#39; object has no attribute &#39;drivername&#39;

今天在配置OpenStack的Glance时,前边进行的都很顺利,当作到这一步时sudo glance-manage db_sync时出现了如下错误 根据错误提示,想到可能是配置问题,于是就查找了配置文档,发现需要在/etc/glance/glance-registry.conf和/etc/glance/glance-api.conf中加入下面一句话 sql_connection = mysql://glance:[email protected]/glance 格式如下:sql_connect

Python python __def__ Exception AttributeError: &quot;&#39;NoneType&#39; object has no attribute

class Person: '''Represents a person.''' population = 0 def __init__(self,name): '''Initializes the person's data.''' self.name = name print '(Initializing %s)' % self.name Person.population +=1 def __del__(self): '''I am dying.''' print '%s says bye

python提示AttributeError: &#39;NoneType&#39; object has no attribute &#39;append&#39;

在写python脚本时遇到AttributeError: 'NoneType' object has no attribute 'append' a=[] b=[1,2,3,4] a = a.append(b) 执行一次后发现a的类型变为了NoneType. 下次执行时就会出现如题所示的错误. 把a = a.append(b)改为a.append(b)后问题解决. 原因:append会修改a本身,并且返回None.不能把返回值再赋值给a. python提示AttributeError: 'Non

python-pip升级报错- AttributeError: &#39;NoneType&#39; object has no attribute &#39;bytes&#39;

正常的pip升级命令: python -m pip install --upgrade pip 在pytharm里面创建了一个Python项目,pytharm会自动搭建一个新的Python环境,在当前的目录下使用 python -m pip install --upgrade pip 会报错 AttributeError: 'NoneType' object has no attribute 'bytes' 可以使用如下方式 easy_install -U pip python-pip升级报错-

python提示AttributeError: &#39;NoneType&#39; object has no attribute &#39;append&#39;【转发】

在写python脚本时遇到AttributeError: 'NoneType' object has no attribute 'append' a=[] b=[1,2,3,4] a = a.append(b) 执行一次后发现a的类型变为了NoneType. 下次执行时就会出现如题所示的错误. 把a = a.append(b)改为a.append(b)后问题解决. 原因:append会修改a本身,并且返回None.不能把返回值再赋值给a.--------------------- 作者:冰雪凌萱

Python问题——AttributeError: &#39;NoneType&#39; object has no attribute &#39;append&#39;

python提示AttributeError: 'NoneType' object has no attribute 'append' Python问题——AttributeError: 'NoneType' object has no attribute 'append' f=open("data.csv")for line in f: line = line.strip("\n") ls = line.split(",") lt=[] for

关于AttributeError: &#39;NoneType&#39; object has no attribute &#39;send_keys&#39;

在学web自动化测试时,通过PO模型将特定页面的一些元素及元素操作放在特定页面模块中, 然后提取公共的部分, 如元素等待WebDriverWait, 元素操作send_keys, click, 获取元素文本信息, 获取属性值等, 放在公共的页面模块里, 即base_page.py, 但在实现过程中我的代码报了错: 想了很久都没发现错在哪里, 那种感觉真不好受... 昨夜西风凋碧树.. 衣带渐宽终不悔... 众里寻他千百度.... 咦, 那个错误不就在眼皮底下么? 原来是少了一个 return .

AttributeError: &#39;module&#39; object has no attribute &#39;dumps&#39;

报错: [[email protected] ~]# ./json.py DATA: [{'a': 'A', 'c': 3.0, 'b': (2, 4)}] Traceback (most recent call last): File "./json.py", line 4, in <module> import json File "/root/json.py", line 8, in <module> data_string = jso