我创建了一个从 Neopets登录页面开始并自动填充用户名和密码的用户脚本。我无法让脚本单击巨大的绿色“登录”按钮。
$('input[name=username']).val('username_here');
$('input[name=password']).val('password_here');
我已经尝试了以下所有方法来单击登录按钮或提交表单。
//None of these clicked the sign in button:
$("input.submit[name = 'welcomeLoginButton']").submit();
$("input.submit[name = 'welcomeLoginButton']").click();
$('body').on('click','welcomeLoginButton',function(){alert('logged in?');});
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.cssSelector("input.submit[name = 'welcomeLoginButton']"))).click();
我知道没有名为“welcomeLoginButton”的元素,只有一个名为.welcomeLoginButton
. 填写用户名和密码后,如何让表单自行提交?