Return node index list from Javascript as string instead of list so we don't have to join it in C++
This commit is contained in:
parent
54d7df3c4c
commit
879eeba471
12
src/Find.cpp
12
src/Find.cpp
|
@ -17,17 +17,7 @@ void Find::receivedArgument(const char *xpath) {
|
|||
QVariant result = page()->mainFrame()->evaluateJavaScript(javascript);
|
||||
|
||||
if (result.isValid()) {
|
||||
QVariantList nodes = result.toList();
|
||||
bool addComma = false;
|
||||
|
||||
double node;
|
||||
for (int i = 0; i < nodes.size(); i++) {
|
||||
node = nodes[i].toDouble();
|
||||
if (addComma)
|
||||
response.append(",");
|
||||
response.append(QString::number(node));
|
||||
addComma = true;
|
||||
}
|
||||
response = result.toString();
|
||||
|
||||
std::cout << "<< Got result:" << std::endl;
|
||||
std::cout << response.toAscii().data() << std::endl;
|
||||
|
|
|
@ -11,7 +11,7 @@ Capybara = {
|
|||
this.nodes[this.nextIndex] = node;
|
||||
results.push(this.nextIndex);
|
||||
}
|
||||
return results;
|
||||
return results.join(",");
|
||||
},
|
||||
|
||||
attribute: function (index, name) {
|
||||
|
|
Loading…
Reference in New Issue