![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
Zhang_先生
这个作者很懒,什么都没留下…
展开
-
TypeError: 'WebElement' object is not iterable
使用元素定位获取元素列表循环时报错原因:需要使用定位到多个元素,错误的使用了element方法,find_element()会返回一个WebElement节点对象,而不是多个元素对象。当你想要把获取的多个元素进行操作时会出现以上错误,此时使用会返回一个元素列表,就不会出现此错误...原创 2019-12-17 11:26:45 · 1102 阅读 · 0 评论 -
python os.path模块
os.pathimport ospath1= os.path.realpath(__file__)#返回绝对路径path2= os.path.abspath(__file__)#返回真实路径path3= os.path.split(os.path.abspath(__file__)) # 返回一个元祖,为路径与文件名称path4= os.path.split(os.path.absp...原创 2019-11-28 16:12:59 · 155 阅读 · 0 评论 -
Python --While循环
Python-Whilewhile循环实例1// An highlighted blocksign =Truequestionnaire ={}while sign: name =input('您的名称是:') place =input('您喜欢的地方是:') questionnaire[name] = place #创建键值对 select =input...原创 2019-08-26 11:47:28 · 366 阅读 · 1 评论 -
Python--修改列表中所有的元素
此段代码循环了列表中的值 但是不会修改列表// An highlighted blockdef make_great(magicians): for magician in magicians: #每次循环拿到列表的的值进行赋值给magician magician = "the Great " + magician #打印出magician的的值...原创 2019-08-27 18:00:44 · 7040 阅读 · 5 评论 -
TypeError: descriptor '__init__' requires a 'super' object but received a 'str'错误
TypeError: descriptor ‘init’ requires a ‘super’ object but received a ‘str’class car: "一辆车的信息,为主类" def __init__(self,car_type,car_colour,car_price): self.car_type =car_type se...原创 2019-09-12 11:34:07 · 1607 阅读 · 0 评论