i want to access a webpage of a local appliance. This is a part of the HTML code of that page:
<div class="form-container">
<h2 class="form-signin-heading">Please Log In</h2>
<div class="form-group input-group auth focus">
<label for="user_account" class="visuallyhidden">Username:</label>
<span class="input-group-addon"><i class="icon-user"></i></span>
<input autofocus="autofocus" class="form-control auth" id="user_account" maxlength="128" name="user[account]" placeholder="Enter User Name" size="128" type="text" />
</div>
<div class="form-group input-group auth">
<label for="user_password" class="visuallyhidden">Password:</label>
<span class="input-group-addon"><i class="icon-lock"></i></span>
<input autocomplete="off" class="form-control auth" id="user_password" maxlength="128" name="user[password]" placeholder="Enter Password" size="128" type="password" />
</div>
<input type="hidden" id="window_size" name="window_size"/>
<input type="hidden" id="url_hash" name="url_hash"/>
<button id="logInButton" class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</div>
I want to enter a username and a password and then login via the login button. The script worked before i update the appliance. Now i cant get it to work again.
This is my script:
page.open("https://10.84.163.146/login/login", function(status){
console.log(page.content);
});
page.render('Bild2.png');
console.log(page.content);
page.evaluate(function(){
console.log(document.getElementsByClassName("form-group input-group auth"));
console.log(document.getElementById("user_account"));
document.getElementsByClassName("form-control auth").value="op";
The console output is this:
/Desktop$ phantomjs --ignore-ssl-errors=true check.js
<html><head></head><body></body></html>
[object NodeList]
null
So when printing the page.content it is empty, and the rendered picture is also blank. But if it can't find/open the page, why does if find a [object NodeList] but not the user_account element?