Get data from web page using JavaScript in BluePrism

杀马特。学长 韩版系。学妹 提交于 2019-12-05 18:33:52

Unfortunately there is no quick way of doing that, however there is a very easy workaround.

You need to create a "bridge" between JavaScript and Blue Prism, something both technologies can interact with. In this case the simplest bridge is an HTML textbox.

JavaScript can create and write to a temporary, invisible textbox on the page and Blue Prism can spy it and read from it.

I use the following script to add the textbox and/or clear its value...

if (document.getElementById("JSOutput") == null){
    // Add invisible textbox
    var body = document.getElementsByTagName("body")[0];
    var text = document.createElement("input");
    text.id = "JSOutput";
    text.style.display = "none";
    body.insertBefore(text, body.firstChild);
}
else  {
    // Clear invisible textbox
    document.getElementById("JSOutput").innerText = "";
}

... and then the following script to write something to it.

var output = document.getElementById("JSOutput");
output.innerText = "Hello World!"

You can then spy or manually add the element into application modeler:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!