See image here
<p style="margin:1em auto; padding:0 1em; max-width:700px;">
<b>
Lamborghini</b>
<br>
<img style="width:300px" src="https://i0.wp.com/www.car-revs-daily.com/wp-content/uploads/2016/02/2011-Lamborghini-EGOISTA-22.jpg">
<br>
2013 Lamborghini Egoista</p>
I want to extract the name of the car [ 2013 Lamborghini Egoista] Which is RANDOM.
This is the website:
https://perchance.org/random-vehicle-car-generator
I tried
String text= (String) jsExecutor.executeScript("document.querySelector('#output-container p').innerText;");
System.out.println(text);
org.openqa.selenium.JavascriptException: javascript error: Cannot read properties of null (reading 'innerText')