2019年4月27日

python报object() takes no parameters错误

摘要: 首先创建一个类class BaseView(object): def _init_(self,driver): self.driver=driver def find_element(self,*loc): return self.driver.find_element(*loc)运行发现报obje 阅读全文

posted @ 2019-04-27 22:02 -有风来 阅读(273) 评论(0) 推荐(0) 编辑

python之调用def __init__(self,driver)

摘要: def __init__(self,driver) 写一个构造函数,有一个参数driver init相当于构造方法,初始化就会自动调用 在调用class类时,如果有 构造函数,它和class调用本身没有关系,而和class的调用的地方有关系,如果在def内部去调用,则使用self的方式,如果在def 阅读全文

posted @ 2019-04-27 15:51 -有风来 阅读(6793) 评论(0) 推荐(1) 编辑

导航