I need to open the first link of a search on youtube in a Webview

0

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");
    }    
    
asked by anonymous 03.10.2018 / 19:10

0 answers