The webview will not be visible, so the goal is to automatically open the first video in the search. I think it's not too complicated in JS.
code:
public class FXMLDocumentController implements Initializable {
@FXML
private WebView tela;
@FXML
private Button botão;
WebEngine webengine;
@Override
public void initialize(URL url, ResourceBundle rb) {
webengine = tela.getEngine();
webengine.load("https://www.youtube.com/results?search_query=exemplo");
}