I am trying to access the Udemy site and trying to log in via javascript , but I am unfortunately not able to trigger the click action on "log in" link.
This is the url.
.click()
does not seem to be working , when I select the element.
Basically only after I trigger the link with a "click", the modal opens up.
And since the .click()
is not working on the link , I am not able to open the login modal.
var id = document.getElementById("id_email");
var password = document.getElementById("id_password");
var submit = document.getElementById("submit-id-submit");
id.value = "XXXX@gmail.com";
password.value="XXXXX";
submit.click();
The above script works for me only if I manually click the Login link and then execute this script. Like I said I want the click() action on the login button to work , so I can completely automate this login action.
I am struck on how to trigger the click on this element
document.getElementsByTagName("require-auth")[0].querySelectorAll("a");
Although the element is selected. when I try the click() on the element , I get the following error
VM2907:1 Uncaught TypeError: document.getElementsByTagName(...)[0].querySelectorAll(...).click is not a function(…)