python - 类型错误: 'module' 对象不可调用(导入 Selenium 时)

标签 python firefox selenium webdriver typeerror

我在运行这段代码时遇到了问题:

>>> from selenium import webdriver
>>> driver = webdriver.firefox()
Traceback (most recent call last):
File "<pyshell#19>", line 1, in <module>
driver = webdriver.firefox()
TypeError: 'module' object is not callable

我已经搜索了问题并得到了一些结果。但不幸的是,它们没有用。那么,我该如何解决呢?

谢谢。

最佳答案

你打错了。

webdriver.Firefox()

注意大写的 F。

关于python - 类型错误: 'module' 对象不可调用(导入 Selenium 时),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16626734/

相关文章:

testing - 驱动多个相互交互的浏览器

java - 如何使用 XPATH 转到搜索结果中的第二页或下一页

JavaScript print() 不带 URL 和日期

python - 如何将自定义参数添加到 Python 日志格式化程序中?

python - 如何从 OpenCV 中已标记的图像中获取区域属性?

python - Flask SQLAlchemy 不关闭 MySQL 数据库连接

javascript - MouseEvent.mozPressure 已弃用。使用 PointerEvent.pressure 代替

jQuery .submit() 不会在 Firefox 中发送输入提交

selenium - 如何通过 Selenium 脚本获取移动 native 应用程序中元素的页面源?

Python 嵌套 For 循环,带有两个字典,内部循环不重置