I am trying to click on button from Chrome console
<a class="toolTip ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only" href="#" role="button" aria-label="next page" data-hasqtip="211" oldtitle="next page" title="" aria-describedby="qtip-211">
<span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-e"></span>
<span class="ui-button-text"></span></a>
i have tried
document.querySelector("#results > div.results_navigation.top_results_navigation.displayButtons > div.results_pager.ui-widget-content > div.arrow_container > a:nth-child(4)").Click();
But it does not work
Js functions are case sensitive and you are using Click instead of click. Also your html and js code not match. So...
//check if btn was clicked
document.querySelector(".next_page").onclick = function() {
// indicate that btn was clicked
this.innerText = 'clicked';
// set back the text after half a second
setTimeout(() => document.querySelector(".next_page").innerText = 'button', 500);
};
// click the button every second
setInterval(() => document.querySelector(".next_page").click(), 1000);
<a class="next_page" href="#" role="button" aria-label="next page" data-hasqtip="211" oldtitle="next page" title="" aria-describedby="qtip-211">
<span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-e"></span>
<span class="ui-button-text">button</span></a>
If the click handlers are added by jQuery, often the native click() method on the HTMLElement will not trigger the jQuery handlers. You can use jQuery to trigger the click and it should trigger the handlers bound with jQuery.
$('#results > div.top_results_navigation > div.results_pager a[aria-label="next page"]').trigger('click'); // or .click() even