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 vs2022无法联网
  • ¥15 TCP的客户端和服务器的互联
  • ¥15 VB.NET操作免驱摄像头
  • ¥15 笔记本上移动热点开关状态查询
  • ¥85 类鸟群Boids——仿真鸟群避障的相关问题
  • ¥15 CFEDEM自带算例错误,如何解决?
  • ¥15 有没有会使用flac3d软件的家人
  • ¥20 360摄像头无法解绑使用,请教解绑当前账号绑定问题,
  • ¥15 docker实践项目
  • ¥15 利用pthon计算薄膜结构的光导纳