0

我正在尝试在打开https://steamcommunity.com/login/时自动登录。

使用 submit() 或 click() 会将我重定向到https://steamcommunity.com/login/#而不是登录。如果我删除 steamLoginForm.submit(); 并手动单击按钮即可工作;所以我假设我必须以不同的方式点击/提交。

// ==UserScript==
// @name     SteamLogin
// @include  https://steamcommunity.com/login/
// ==/UserScript==


var steamLoginForm = document.getElementById("loginForm");

steamLoginForm.elements.namedItem("steamPassword").setAttribute("autocomplete", "on");
steamLoginForm.elements.namedItem("remember_login").checked = true; 
steamLoginForm.elements.namedItem("steamAccountName").value = "accountName";
steamLoginForm.submit();

4

1 回答 1

0

我只是简单地使用以下内容。

document.getElementById("steamAccountName").value="username";
document.getElementById("steamPassword").value="password";
document.getElementById("SteamLogin").click();

于 2018-06-24T09:26:46.850 回答