m0_57965808 2021-10-04 12:34 采纳率: 91.6%
浏览 227
已结题

selenium下载出现了问题,AttributeError: module 'selenium.webdriver' has no attribute 'chromedriver'

如图:

img

img


另外想问一下,用selenium爬取整个网站合适么?有没有什么更好的办法?

  • 写回答

2条回答 默认 最新

  • 关注

    你用 Windows 要下载 chromedriver_win32.zip 然后,解压缩 chromedriver.exe
    executable_path 要指到 chromedriver.exe

    import selenium
    from selenium import webdriver
    driver = webdriver.chrome.webdriver.WebDriver(executable_path='C:/drivers/chromedriver_win32/chromedriver.exe')
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
  • 关注
    
    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    
    options = Options()
    options.binary_location = "C:\\Program Files\\Chrome\\chrome64_55.0.2883.75\\chrome.exe"
    driver = webdriver.Chrome(chrome_options = options, executable_path=r'C:\path\to\chromedriver.exe')
    driver.get('http://google.com/')
    print("Chrome Browser Invoked")
    driver.quit()
    
    
    评论
查看更多回答(1条)

报告相同问题?

问题事件

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

悬赏问题

  • ¥15 求一个智能家居控制的代码
  • ¥15 ad软件 pcb布线pcb规则约束编辑器where the object matpcb布线pcb规则约束编辑器where the object matchs怎么没有+15v只有no net
  • ¥15 虚拟机vmnet8 nat模式可以ping通主机,主机也能ping通虚拟机,但是vmnet8一直未识别怎么解决,其次诊断结果就是默认网关不可用
  • ¥20 求各位能用我能理解的话回答超级简单的一些问题
  • ¥15 yolov5双目识别输出坐标代码报错
  • ¥15 这个代码有什么语法错误
  • ¥15 给予STM32按键中断与串口通信
  • ¥15 使用QT实现can通信
  • ¥15 关于sp验证的一些东西,求告知如何解决,
  • ¥35 关于#javascript#的问题:但是我写的只能接码数字和字符,帮我写一个解码JS问题