This is because the form doesn't have a class of "loginf", that's the value of the name attribute. You could try using an attribute selector:
Thank you, this was perfect. I may make another Q for this, but if you have a moment, this is my next problem. After I evaluated a page (put it credentials, and logged in) I want to go to another page. I know I can put another "page.open" outside of the page.evaluate but inside the first page.open, but cookies seem to be lost after this. Anyway to keep the cookies?
An alternative is to click on the link: <a href="/questions"><i class="fa fa-question-circle"></i>Questions</a> But I am not sure how to get that from just that.
Well for the first method, one thing you could do is grab the cookies inside the page.evaluate call and store it to a global that can access them later on in that first page.open. Try using page.cookies and page.addCookie to add back the pertinent cookies
For the alternative you proposed, you could use the same line of thinking as for getting the element with name loginf. document.querySelector("a[href=/questions]").click();
SyntaxError: DOM Exception 12: An invalid or illegal string was specified. undefined:8 in querySelector :8 :15
TypeError: null is not an object (evaluating 'document.querySelector("a[href='/questions']").click') undefined:10 :15