I'm doing an app using JavaScript to collect contacts from Google Contacts. What I need to do is navigate to this site, click on a DIV and extract the HTML source.
Problem is, when I manually click on the DIV, the website has the expected behaviour. But when I call click
on the same DIV programatically, nothing happens.
Here is the DIV in question :
<div id=":se" class="tk3N6e-LgbsSe VIpgJd-TzA9Ye-eEGnhe Ycq2Ve tk3N6e-LgbsSe-roVxwc tk3N6e-LgbsSe-n2to0e tk3N6e-LgbsSe-vhaaFf-LK5yu ipG21e" role="button" tabindex="0" data-tooltip="Next" aria-label="Next" style="user-select: none;">
<span class="Fj0vqf" aria-hidden="true"> </span>
<img class="P1rG1b tk3N6e-LgbsSe-RJLb9c" src="images/cleardot.gif" alt="">
</div>
To achieve the task, I'm using this JS :
document.getElementsByClassName('tk3N6e-LgbsSe')[7].click();
Although the selector above return the correct node, when I call .click()
, nothing happens. What am I missing here?
Below is the site image with the DIV in question highlighted: