AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘ 新手情况

**

AttributeError: module ‘selenium.webdriver’ has no attribute ‘Chrome’ 新手情况

**
描述:
自己在ide直接创建一个谷歌浏览器没有问题
转到pychram的时候报这个错
这是一个新手问题
解决:
报错原因是没有在pychram中安装selenium的模块
在setting-project Interpreter中添加这个模块
另外:
如果说之前导过,但是现在不行了
可能原因是你又打开了一个新的项目,而这个项目是需要再次导入的

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
AttributeError: module 'selenium.webdriver' has no attribute 'Chrome'错误是由于selenium库中的webdriver模块没有Chrome属性引起的。这个错误通常发生在使用过时的代码或版本过低的selenium库时。为了解决这个问题,你需要确保你安装的selenium库是最新版本,并且使用正确的方法来实例化Chrome浏览器对象。 首先,确保你的selenium库是最新版。你可以通过在命令行中运行以下命令来更新selenium库: ``` pip install --upgrade selenium ``` 然后,你可以尝试使用以下代码来实例化Chrome浏览器对象: ``` from selenium import webdriver browser = webdriver.Chrome() ``` 这里使用的是webdriver模块中的Chrome属性来实例化Chrome浏览器对象。确保你已经正确安装了Chrome浏览器以及Chrome驱动程序,并将Chrome驱动程序的路径添加到系统环境变量中。 如果你仍然遇到相同的错误,请确保你的代码中没有其他地方导入了selenium.webdriver模块并覆盖了webdriver属性,或者查看你的代码中是否存在其他潜在的错误。 总结起来,要解决AttributeError: module 'selenium.webdriver' has no attribute 'Chrome'错误,你需要确保你的selenium库是最新版本,并使用正确的方法实例化Chrome浏览器对象。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [已解决(最新版selenium报错)AttributeError: moduleselenium.webdriver‘ has no attribute ...](https://blog.csdn.net/yuan2019035055/article/details/125830305)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

略略略气气你

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值