I attempt to automatically click on the button "Load more" in the following link javafx webview https://www.youtube.com/channel/UCK-ds1Wsdd2wn1JElOIUSWQ/videos
Source code in Youtube : "Load more" as below
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-default load-more-button yt-uix-load-more browse-items-load-more-button" type="button" onclick=";return false;" aria-label="Load more
" data-uix-load-more-target-id="browse-items-primary" data-uix-load-more-href="/browse_ajax?action_continuation=1&continuation=4qmFsgI8EhhVQ0stZHMxV3NkZDJ3bjFKRWxPSVVTV1EaIEVnWjJhV1JsYjNNZ0FEQUNPQUZnQVdvQWVnRXp1QUVB"><span class="yt-uix-button-content"> <span class="load-more-loading hid">
<span class="yt-spinner">
<span class="yt-spinner-img yt-sprite" title="Loading icon"></span>
Loading...
</span>
</span>
<span class="load-more-text">
Load more
</span>
</span></button>
JqueryEmbed.executejQuery use of jewelsea https://gist.github.com/jewelsea/3077942
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
WebEngine engine = browser.getEngine();
engine.documentProperty().addListener((ObservableValue<? extends Document> observable, Document oldValue, Document newValue) -> {
JqueryEmbed.executejQuery(engine, "$(document).ready(function(){"
+ "$('button.browse-items-load-more-button').click();"
+ "});");
});
engine.load("https://www.youtube.com/channel/UCK-ds1Wsdd2wn1JElOIUSWQ/videos");
}
If I use the jquery hidden button "load more" to test it works.
+ "$('.browse-items-load-more-button').hide();"
But when the user clicks it does not work,
+ "$('button.browse-items-load-more-button').click();"
and the button that contains the following code
onclick = "; return false;"
We tried but I failed, program error, I do not know how to fix it
Please help me