Web automation from C++(来自 C++ 的 Web 自动化)
问题描述
我们需要从 C++ 应用程序执行一些相当复杂的 Web 自动化(登录到应用程序、执行一些操作、注销),但性能非常重要,因此我们正在研究选项.
We need to do some fairly complex web automation from C++ application (log into application, do some actions, logout), but performance is really important so we are looking at options.
有没有一种方法可以直接从 C++ 驱动 WebKit 或其他 headless 引擎,而无需在其间添加更多层(例如 selenium+webdriver+网络通信+...)?可能是 Chrome 驱动程序?
Is there a way to drive WebKit or other headless engine directly from C++, without the need for few more layers in between (like selenium+webdriver+network communication+...)? Chromedriver perhaps?
如果选项 1 不可行,从 C++ 运行 WebDriver(使用真实浏览器)的最佳方式是什么?
If option 1 is not possible, what is the most optimal way to run WebDriver (with real browser) from C++?
推荐答案
你应该看看 PhantomJS(一个无头 WebKit浏览器),它带有 GhostDriver,这是 PhantomJS 的 WebDriver 协议实现.
You should look into PhantomJS (a headless WebKit browser), which comes with GhostDriver, which is the WebDriver protocol implementation for PhantomJS.
您仍然需要使用我不知道的 WebDriver 语言绑定之一C++ 中的任何语言绑定,但也许您的团队可以将其中一种可用语言用于自动化目的.
You will still need to use one of the WebDriver language bindings, which I'm not aware of any of the language bindings that are in C++, but perhaps one of the available languages could be used by your team for automation purposes.
最坏的情况是,您始终可以在 Python 中创建 WebDriver 脚本,然后从您的 C++ 应用程序中调用 Python 脚本.
Worst case, you could always create your WebDriver script in Python, and call the Python script from your C++ application.
这篇关于来自 C++ 的 Web 自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:来自 C++ 的 Web 自动化


基础教程推荐
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 这个宏可以转换成函数吗? 2022-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- 我有静态或动态 boost 库吗? 2021-01-01