qq_42458215 2022-11-05 17:20 采纳率: 74.3%
浏览 46
已结题

如果解决不了这个问题,这辈子也玩不了爬虫了

问题遇到的现象和发生背景
用代码块功能插入代码,请勿粘贴截图
我想要达到的结果
from selenium import webdriver
webdriver=webdriver.Chrome(r"C:\Users\24928\Anaconda3\share\jupyter\kernels\python3\chromedriver.exe")
webdriver.get(url='https://www.baidu.com')


C:\Users\24928\AppData\Local\Programs\Python\Python37\python.exe C:/Users/24928/PycharmProjects/佛子/佛子.py
C:/Users/24928/PycharmProjects/佛子/佛子.py:2: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
webdriver=webdriver.Chrome(r"C:\Users\24928\Anaconda3\share\jupyter\kernels\python3\chromedriver.exe")
Traceback (most recent call last):
File "C:/Users/24928/PycharmProjects/佛子/佛子.py", line 2, in
webdriver=webdriver.Chrome(r"C:\Users\24928\Anaconda3\share\jupyter\kernels\python3\chromedriver.exe")
File "C:\Users\24928\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 72, in init
service_log_path, service, keep_alive)
File "C:\Users\24928\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 97, in init
options=options)
File "C:\Users\24928\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 272, in init
self.start_session(capabilities, browser_profile)
File "C:\Users\24928\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 364, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\24928\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 429, in execute
self.error_handler.check_response(response)
File "C:\Users\24928\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
Stacktrace:
Backtrace:

Process finished with exit code 1

  • 写回答

2条回答 默认 最新

  • CSDN专家-sinJack 2022-11-05 17:29
    关注

    把chromedriver放到你的浏览器根目录下。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 11月5日
  • 已采纳回答 11月5日
  • 创建了问题 11月5日

悬赏问题

  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?