vendor_prefix 硒网络驱动程序

vendor_prefix selenium webdriver

我要执行cdp commands using asyncio and like the execute_cdp_cmd command in selenium and i also found the undocumented (maybe i dont have the correct documentation) endpoint url of the chrome webdriver, see here executeCdpCommand.

self._commands['executeCdpCommand'] = ('POST', '/session/$sessionId/{}/cdp/execute'.format(vendor_prefix))

如您所见,我需要 vendor_prefix 才能正确执行 cdp 命令。 我找到的唯一一句话是在 ChromiumDriver in selenium.

的源文档字符串中
 - vendor_prefix - Company prefix to apply to vendor-specific WebDriver extension commands.

我在互联网上找不到任何有用的东西,有没有人知道答案并可以给我一个例子

我在 java source 中找到了 selenium 的 google chrome 供应商前缀,webdriver 期望它是:

  @Override
  public Map<String, CommandInfo> getAdditionalCommands() {
    return ImmutableMap.of(
      EXECUTE_CDP, new CommandInfo("session/:sessionId/goog/cdp/execute", HttpMethod.POST));
  }