'puphpeteer Copy text from textarea to variable

Good afternoon, for several days I have been trying to find a solution on how to implement copying text from a text area to a variable, I will be very grateful to you for a hint on how this can be implemented, I tried this code, but it does not work for me

$text = $page->evaluate(JsFunction::createWithParameters(['document'])
    ->body('return document.getElementById("tText").value;'));


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source