初次写python 代码,采用百度demo,遇到问题:
AttributeError: ‘xxxxx’ object has no attribute ‘driver’
AttributeError: ‘xxxxx‘ object has no attribute ‘driver‘
AttributeError: ‘xxxxx‘ object has no attribute ‘driver‘

根据建议, 解决布置如下:

  1. 规范代码,完善缩进
  2. 检查chromedriver (正确)
  3. 再次检查代码,发现 setup里面的小写u应该改成大写U, 应该改成setUp (问题所在)
  4. 重新运行,成功

关于setUp()和tearDown()函数: https://www.cnblogs.com/insane-Mr-Li/p/9085062.html

AttributeError: ‘xxxxx‘ object has no attribute ‘driver‘
AttributeError: ‘xxxxx‘ object has no attribute ‘driver‘

相关文章:

  • 2021-06-21
  • 2021-08-31
  • 2021-12-04
  • 2021-07-25
  • 2021-06-16
  • 2021-08-06
  • 2021-06-13
  • 2022-01-08
猜你喜欢
  • 2021-09-01
  • 2022-12-23
  • 2021-09-15
  • 2021-12-07
  • 2021-12-14
  • 2021-06-06
  • 2021-07-27
相关资源
相似解决方案