segment-boneyard / nightmare

A high-level browser automation library.
https://open.segment.com
19.54k stars 1.08k forks source link

Nightmare.js not saving login session #1622

Closed Levelleor closed 3 years ago

Levelleor commented 3 years ago

Tried using nightmare.js to log in to Steam, though it simply ignores my credentials and stays logged off. There're no messages from Steam or Nightmare.js, it just moves on with the script as if the login was successful, but it wasn't.

await nightmare
  .goto('https://store.steampowered.com/login/')
  .wait(3000)
  .type('#input_username', 'USERNAME')
  .type('#input_password', 'PASSWORD')
  .click('#login_btn_signin>button')
  .wait(3000) //here I will wait 3 seconds on the main page, but still not logged in

Is it Electron's issue, or Nightmare.js? Anyone had this issue? I don't know how to proceed from here.

Levelleor commented 3 years ago

Ok, I didn't find a solution to this, instead, I've set the cookie for age, thus login wasn't needed anymore, which is fine by me. Though in the future if I'll need to be able to login I'll probably use Puppeteer instead, looks like it's still maintained and works well with sessions. This is just a suggestion since I've searched a lot of web suggestions and people are usually simply logging in as I did above, but for me, it doesn't work for some reason.