【问题标题】:Python Selenium WinError 193Python 硒 WinError 193
【发布时间】:2021-09-15 15:56:39
【问题描述】:
from selenium import webdriver

PATH = "C:/Program Files (x86)/chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("www.google.com")

我收到此错误

OSError: [WinError 193] %1 is not a valid Win32 application,

我刚开始学习 Python,想使用 Selenium。有谁知道我需要做什么来修复错误?

【问题讨论】:

  • 你从哪里下载了chromedriver.exe
  • 也许可以尝试在路径中使用反斜杠...
  • @pcalkins 我试过了,没用,谢谢评论:)
  • @NeedforAnwserslol : 你能把那个 chromedriver.exe 放到不同的位置吗,可能在 D 驱动程序中,然后再试一次,看看是否有帮助。

标签: python selenium webdriver


【解决方案1】:

OSError: [WinError 193] %1 不是有效的 Win32 应用程序

这意味着该文件不是有效的可执行文件。

解决方法如下:

  1. Redownload ChromeDriver.exe
  2. 把它放在C:/Program Files (x86)/chromedriver.exe
  3. 将代码中的第 2 行更改为 PATH = "C:\Program Files (x86)\chromedriver.exe"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-22
    • 2019-02-24
    • 2021-12-25
    • 2020-02-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多