You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Selenium初始化Chrome驱动报错:'module' object is not callable

问题解决:TypeError: 'module' object is not callable

你的错误根源是大小写拼写错误:在Selenium中,实例化Chrome驱动的正确写法是webdriver.Chrome(),而非webdriver.chrome()。

原因解释

  • webdriver.chrome是一个模块对象,本身不可被调用,因此会抛出"`module' object is not callable"的错误;
  • webdriver.Chrome()才是Selenium提供的、用于创建Chrome驱动实例的可调用类。

修正后的代码

from selenium import webdriver
driver = webdriver.Chrome()

额外说明

不需要重复重装驱动、浏览器、Selenium或Python,这个问题和环境配置无关。如果使用的是Selenium 4.6及以上版本,Selenium会自动通过内置的Selenium Manager管理驱动,无需手动下载或配置环境变量。

内容的提问来源于stack exchange,提问作者No Name

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 04:59:52