screenshot
screenshot($file_path,$as_gray=false); - save a screenshot of the element via the DOM model to disk
The function accepts parameters as input:
$file_path – path to the file where the screenshot of the element will be saved. By default, the screenshot format is jpeg. The following screenshot file formats are also supported (set by the file extension): bmp,gif,png. The path to the file can be full (with the disk specified) so the relative path will be added to the folder where the php file of the running script is located.$as_gray – specifies to take a screenshot in gray (true), available from version 7.0.6
After testing, the function returns the result of its work to the script (the return value type is boolean):
true – completed successfullyfalse – it was not possible to find such an element (for example, there are no elements that meet the specified criteria or there is no such frame)