来自 C++ 的 Web 自动化 [英] Web automation from C++

查看:36
本文介绍了来自 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.

  1. 有没有一种方法可以直接从 C++ 驱动 WebKit 或其他 headless 引擎,而无需在其间添加更多层(例如 selenium+webdriver+网络通信+...)?可能是 Chrome 驱动程序?

  1. 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 自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆