From ec16676c7719bdf62d628e0c6a4c6ffd826d431a Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 2 Dec 2024 22:08:14 +0200 Subject: [PATCH] Normalize behavior of "getText" method --- src/Selenium2Driver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)