Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Use textContent to retrieve text of nodes. #216

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion src/WebPage.cpp
Expand Up @@ -20,7 +20,6 @@ WebPage::WebPage(QObject *parent) : QWebPage(parent) {
this, SLOT(frameCreated(QWebFrame *)));
connect(this, SIGNAL(unsupportedContent(QNetworkReply*)),
this, SLOT(handleUnsupportedContent(QNetworkReply*)));
this->setViewportSize(QSize(1680, 1050));
}

void WebPage::setCustomNetworkAccessManager() {
Expand Down
8 changes: 1 addition & 7 deletions src/capybara.js
Expand Up @@ -32,13 +32,7 @@ Capybara = {
},

text: function (index) {
var node = this.nodes[index];
var type = (node.type || node.tagName).toLowerCase();
if (type == "textarea") {
return node.innerHTML;
} else {
return node.innerText;
}
return this.nodes[index].textContent;
},

attribute: function (index, name) {
Expand Down