报错内容:ImportError: cannot import name ‘webdriver‘ from partially initialized modul。

 你是否如图所示一样出错?为无法导入selenium中的webdriver而烦恼!

那就是文件命名问题了,pycharm会先从当前目录开始寻找模块,所以当前文件的名字不能与selenium这种类似的模块,包相同

python中selenium自动化报错

报错信息

ImportError: cannot import name 'webdriver' from partially initialized module 'selenium' (most likely due to a circular import) (E:\pyc1\二阶段\selenium.py)

 报错内容:ImportError: cannot import name ‘webdriver‘ from partially initialized modul。_第1张图片

有趣的是更改名字后,导入的代码也会同步更改这时我们只需要把"s123"改回selenium就好了

 报错内容:ImportError: cannot import name ‘webdriver‘ from partially initialized modul。_第2张图片

 报错内容:ImportError: cannot import name ‘webdriver‘ from partially initialized modul。_第3张图片

 ps:制作不易,每一个博文都是博主亲身经历失败总结经验而来。

你可能感兴趣的:(python,开发语言)