一尘不染

CreatePlatformSocket()返回错误:提供了无效的参数。(0x2726)尝试通过网络路径访问chromedriver时

selenium

我了解操作系统更新不仅导致chromedriver引起问题,也导致了geckodriver。

当更新的工作站在本地运行它们时,chromedriver和geckodriver都可以毫无问题地启动(例如,驱动器C:\)。当在网络路径中找到这两个时,就会出现问题。

我已经检查了运行这些驱动程序的特定用户的权限,还检查了UAC和防火墙,但它们似乎与问题无关。

为了维护起见,我更喜欢从网络路径运行驱动程序。因为,我有几个自动化站,所以我想集中基础架构。这样,我不需要维护每个站点的基础设施。

我正在使用默认设置运行两个驱动程序,而没有使用它们的选项,我相信也许使用这些选项可以解决问题。

有人熟悉这些问题吗?通过使用驱动程序的选项,是否可以安全地传递这些问题?

顺便说一下,我在Windows 10专业版上运行:1803操作系统内部版本:17134.1

chromedriver版本是2.40.565498 win32,而geckodriver版本是v0.20.1-win64

我收到的错误消息是:

chromedriver

[1530079175.164][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
[1530079175.165][INFO]: listen on IPv4 failed with error ERR_INVALID_ARGUMENT
[1530079175.166][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
[1530079175.166][INFO]: listen on IPv6 failed with error ERR_INVALID_ARGUMENT

壁虎

An invalid argument was supplied. (os error 10022)

阅读 657

收藏
2020-06-26

共1个答案

一尘不染

正如您提到的:

  • 在本地执行时, ChromeDriverGeckoDriver可以 正常 启动(例如C:\驱动器)
  • 在网络路径中找到 ChromeDriverGeckoDriver 时会出现问题。

历史上,根据讨论:

  • CreatePlatformSocket()返回错误:提供了无效的参数。(0x2726)端口不可用。退出……使用chromedriver和Selenium 3.2
  • CreatePlatformSocket()返回错误:提供了无效的参数。(0x27t6)端口不可用。在Selenium Webdriver中退出…

已经观察到 ChromeDriverGeckoDriver 在网络上共享时,在初始化各自的 浏览器客户端时 ,观察到以下错误:

  • 样品A:
        Starting ChromeDriver 2.28.455520 (cc17746adff54984afff480136733114c6b3704b) on port 12121
    Only local connections are allowed.
    [0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
    [0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
    Port not available. Exiting...
    Mar 11, 2017 9:13:06 PM org.openqa.selenium.os.UnixProcess checkForError
    SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
  • 样品B:
        [0.147][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726) 
    [0.147][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x27t6) 
    Port not available. Exiting...
  • 样品C:
        Starting ChromeDriver 2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb) on port 17873
    Only local connections are allowed.
    [1525873930.811][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
    [1525873930.816][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
    Port not available. Exiting...
    May 09, 2018 7:22:30 PM org.openqa.selenium.os.UnixProcess checkForError
    SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
  • 乃至:
        //chromedriver
    [1530079175.164][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
    [1530079175.165][INFO]: listen on IPv4 failed with error ERR_INVALID_ARGUMENT

    //geckodriver
    An invalid argument was supplied. (os error 10022)

    //IEDriverServer
    Failed to start the server with: port = '2305', host = '', log level = '', log file = '', whitelisted ips = ''

因此,一种通用的解决方案是通过将 ChromeDriver 和 _GeckoDriver_放入主机的本地驱动器来访问它们。

2020-06-26