答案 0 :(得分:1)
要正确执行此操作,您需要找到有问题的脚本,并在this.wait.until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver webDriver) {
System.out.println("Searching ...");
return webDriver.findElement(By.id("resultStats")) != null;
}
});
周围添加<span>
标记。你也可以像这样修补它,它也会起作用(但不要!):
您可以重复使用我编写的这个方法来替换任何元素或字符/元素/等的任何元素中的任何字符。
|
var targetSelector = '.small';
function wrapChar(targetSelector, char, replaceWith) {
'use strict';
var content = $(targetSelector).html();
content = content.replace(new RegExp(/\|/, "g"), replaceWith);
return content;
}
$(function() {
$(targetSelector).html(wrapChar(targetSelector, ['|'], '<span class="pipe">|</span>'));
});
.pipe {
font-size: 3em;
}
答案 1 :(得分:0)
Mat src = imread("abc.jpg");
minx = INT_MAX; miny = INT_MAX; maxx = INT_MIN; maxy = INT_MIN;
img0 = src;
channel = img0.channels();
res1 = Mat::zeros(img0.size(), CV_8UC1);
final = Mat::zeros(img0.size(), CV_8UC3);
//////////// source image ///////////////////
namedWindow("Source", 1);
setMouseCallback("Source", mouseHandler, NULL);
imshow("Source", img0);
imshow("mask", res1);
waitKey(0);
img0.release();
img1.release();
function tagIt(parent, untagged, tagType, className) {
var span = document.createElement(tagType);
parent.insertBefore(span, untagged);
span.appendChild(untagged);
span.classList.add(className);
}
function getUntagged(element) {
var children = element.childNodes;
var i = children.length;
var untagged = [];
while (--i) {
if (children[i].nodeType === 3)
untagged.push(children[i]);
}
return untagged;
}
// Working example:
function tagify() {
var container = document.querySelector('.container');
var untagged = getUntagged(container);
untagged.forEach(node => {
tagIt(container, node, 'span', 'tagged');
});
}
document.querySelector('.tagify').addEventListener('click', tagify);
.tagged {
color: red;
font-weight: bold;
font-size: 2em;
}