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

查看:112
本文介绍了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) +网络通讯+ ...)?

  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天全站免登陆