我想使用JS登录一个网站,然后将URL更改为同一网站上的不同页面。我有两个函数,它们各自工作,但不是一起工作。我不知道如何编写/组织这些函数,以便一个函数可以一个接一个地执行。
function autoLogin() {
document.getElementById("userName").value = "username";
document.getElementById("pwd").value = "password";
document.getElementById("LoginButton").click();
}
autoLogin();
function nextPage() {
window.location.replace("https://www.website.com/page2");
}
nextPage();
https://stackoverflow.com/questions/51776976
复制相似问题