Skip to content

Commit

Permalink
Normalize behavior of "getText" method
Browse files Browse the repository at this point in the history
  • Loading branch information
aik099 committed Dec 2, 2024
1 parent c085ffb commit ec16676
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Selenium2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ec16676

Please sign in to comment.