Skip to content

Username field error: Error: No element found for selector: button[type='submit'] #2

Description

@Lekebabiste

Here's my code

import SnapBot from "./snapbot.js";


const bot = new SnapBot();

let credentials = {
  username: "myUsername",
  password: "myPassword",
};

await bot.launchSnapchat({
  headless: false,
  userDataDir: "C:\\Users\\yourname\\AppData\\Local\\Google\\Chrome\\User Data\\Default",
  args: [
    "--start-maximized",
    "--force-device-scale-factor=1",
    "--use-fake-ui-for-media-stream",
    "--allow-file-access-from-files",
    "--enable-media-stream",
  ],
});



await bot.login(credentials);


const logged = await bot.isLogged()  //returns a boolean
  if (!logged) {
    await bot.login(credentials);
  } else {
    console.log("bot is already logged");
  }



const recipients = await bot.listRecipients();
console.log(recipients);

And I got this error in the terminal :
`➜ SnapBot git:(main) ✗ npm run bot

snapbot@1.0.0 bot
node index.js

Username field error: Error: No element found for selector: button[type='submit']
at assert (/home/selofaney/Documents/flamebot/SnapBot/node_modules/puppeteer-core/lib/cjs/puppeteer/util/assert.js:18:15)
at CdpFrame.click (/home/selofaney/Documents/flamebot/SnapBot/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:755:40)
at async SnapBot.login (file:///home/selofaney/Documents/flamebot/SnapBot/snapbot.js:113:7)
at async file:///home/selofaney/Documents/flamebot/SnapBot/index.js:25:1
Waiting for password field...
`
I'm using Arch Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions