2

At the moment, I've got it so then it types in a username, then clicks the drop down menu to select the month, but when I go to actually make it click the month, it just throws an error. Any help?

This is the code I've got so far:

const puppeteer = require("puppeteer");
const { createCursor } = require("ghost-cursor");

genalt();

async function genalt() {
    const browser = await puppeteer.launch({ headless: false });
    const page = await browser.newPage();
    const cursor = createCursor(page);
    await page.goto("https://www.roblox.com");

    setTimeout(async() => {
        await page.evaluate(() => {
            function altName() {
                let oh = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                let ohString = "";
        
                for (var i = 0; i < 6; i++) {
                    ohString += oh.charAt(Math.floor(Math.random() * oh.length));
                }
        
                return `MysticGen_${ohString}`;
            }

            document.querySelector('input[name="signupUsername"]').value = `${altName()}`;
       });

       setTimeout(() => {
            cursor.click('select[name="birthdayMonth"]');
            setTimeout(() => {
                cursor.click('option[value="Jan"]');
            }, 1000)
        }, 1000)
    }, 1000)
}

And this is the error I am getting:

Falling back to JS scroll method ProtocolError: Protocol error (DOM.scrollIntoViewIfNeeded): Node does not have a layout object
    at D:\Downloads\Stuff\Code\Roblox Alt Gen\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:329:24
    at new Promise (<anonymous>)
    at CDPSessionImpl.send (D:\Downloads\Stuff\Code\Roblox Alt Gen\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:325:16)
    at Object.<anonymous> (D:\Downloads\Stuff\Code\Roblox Alt Gen\node_modules\ghost-cursor\lib\spoof.js:463:75)
    at step (D:\Downloads\Stuff\Code\Roblox Alt Gen\node_modules\ghost-cursor\lib\spoof.js:44:23)
    at Object.next (D:\Downloads\Stuff\Code\Roblox Alt Gen\node_modules\ghost-cursor\lib\spoof.js:25:53)
    at fulfilled (D:\Downloads\Stuff\Code\Roblox Alt Gen\node_modules\ghost-cursor\lib\spoof.js:16:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  originalMessage: 'Node does not have a layout object'
}
mystic
  • 21
  • 2

0 Answers0