diff --git a/src/Selenium2Driver.php b/src/Selenium2Driver.php index d24f680..efe892c 100755 --- a/src/Selenium2Driver.php +++ b/src/Selenium2Driver.php @@ -673,11 +673,11 @@ public function getTagName(string $xpath) public function getText(string $xpath) { - return str_replace( - array("\r\n", "\r", "\n"), + return trim(str_replace( + array("\r\n", "\r", "\n", ' '), ' ', $this->executeJsOnXpath($xpath, 'return {{ELEMENT}}.innerText;') - ); + )); } public function getHtml(string $xpath)