Skip to content

Login failure: Instagram changed form selectors (name attributes removed) #177

@riacrdodoria

Description

@riacrdodoria

Bug Report: Login Failure Due to Changed Instagram Form Selectors

Description

The bot fails to login to Instagram because the login form HTML structure has changed. Instagram removed the name attributes from the username and password input fields, causing the current selectors to fail.

Current Behavior

  • Bot attempts to find input[name="email"] - element not found
  • Bot attempts to find input[name="pass"] - element not found
  • Login process fails silently or with timeout errors

Expected Behavior

  • Bot should successfully locate the username and password fields
  • Bot should be able to type credentials and submit the login form

Root Cause

The selectors in src/index.ts (lines ~1259-1265) use outdated selectors:

await page.type('input[name="email"]', myUsername, { delay: 50 });
await page.type('input[name="pass"]', password, { delay: 50 });

Instagram's current login form (as of February 2026) no longer includes these name attributes on the input fields.

Proposed Solution

Update the selectors to use the type attribute, which is more stable:

const usernameInput = await page.waitForSelector('input[type="text"]', { timeout: 5000 });
if (!usernameInput) throw new Error('Username input field not found');
await usernameInput.type(myUsername, { delay: 50 });

const passwordInput = await page.waitForSelector('input[type="password"]', { timeout: 5000 });
if (!passwordInput) throw new Error('Password input field not found');
await passwordInput.type(password, { delay: 50 });

Benefits of This Approach

  1. Uses waitForSelector with explicit timeout
  2. Validates element existence before use
  3. Provides clear error messages
  4. Uses more stable selectors (type attributes)

Environment

  • instauto version: 9.2.1 / 10.0.0
  • Instagram interface: Current (February 2026)
  • Affected projects: SimpleInstaBot and any project using instauto

Additional Context

I have already implemented and tested this fix in a fork:

I'm preparing a Pull Request with this fix.

Impact

This is a critical bug that prevents the bot from functioning at all. Users cannot login to Instagram with the current version.

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