diff --git a/src/WebdriverClassicDriver.php b/src/WebdriverClassicDriver.php index 438abd5..40cfa26 100644 --- a/src/WebdriverClassicDriver.php +++ b/src/WebdriverClassicDriver.php @@ -296,11 +296,11 @@ public function getText( #[Language('XPath')] string $xpath ): string { - return str_replace( - ["\r\n", "\r", "\n"], + return trim(str_replace( + ["\r\n", "\r", "\n", "\xc2\xa0"], ' ', $this->getElementDomProperty($this->findElement($xpath), 'innerText') - ); + )); } public function getHtml(