PYTHON运行Selenium报错:NameError: name 'By' is not defined

NameError: name 'By' is not defined

原因:By类没有导包,系统无法识别By对象

解决方法:

导入By包:

 

from selenium.webdriver.common.by import By

 

----------------------------------温馨提示---------------------------------------

自动导包快捷键:ALT + 回车

 

上一篇:Uncaught ReferenceError: $ is not defined


下一篇:Property xxx was accessed during render but is not defined on instance