Click on item inside dynamic accordion using Puppeteer for nodejs

I’m struggling to find click on an item inside an dynamic loaded accordion.
When the page opens, the first thing i do is click on the accordion button to expand its items. So far so good, i managed to click on it and open the table.

However, i can’t find a way to click on a radio button inside there.
I managed to do it with Selenium, by doing the following:

  1. Get into the selector (div > spaui-datatable > table)

  2. Inside the selector, get all css selector “tr”

  3. Search the tr for the one with an specific item i wanted (numero acordo)
    This is how i did on Selenium:

     var tabelaAcordos = driver.FindElement(By.CssSelector("div > spaui-datatable > table"));
     var linhasTabelaAcordos = tabelaAcordos.FindElements(By.CssSelector("tr"));
     for (int i = 0; i < linhasTabelaAcordos.Count; i++)
     {
     var itensAcordo = HelperMethods.FormataString(linhasTabelaAcordos[i].Text);
     if (itensAcordo[2].Equals(numAcordo))
     {                        
     var acordoTr = new WebDriverWait(driver, TimeSpan.FromSeconds(10))                            .Until(ExpectedConditions.ElementExists(By.XPath("//div[contains(@class, 'spaui-radio-helper-hidden')]//input[@type='radio']")));
    

    acordoTr.SendKeys(Keys.Space);
    }
    }

However i can’t replicate it to puppeteer on nodejs.
I don’t know if its related to the page not being readyloaded or something like that. If i scroll down the page (on the session opened) i can see the items there. But the console.log shows nothing also.

One post i think may have something to do with my question is this one:
Accordions clicked with puppeteer not revealing tables after being clicked

But i couldn’t replicate what was done there =(

This is the accordion i’m trying to click:

Green is the item i’m using as an unique identifier. When i did this with Selenium, i was just getting the line with this number, finding its related radio button and sending an space key (so it would be selected).

This is the HTML code of the part i’m trying to reach. There are others items on this accordion, but already managed to get the one i need.

Any input is really appreciated. Thanks a lot for your attention.

My code:

const puppeteer = require('puppeteer');

(async () => {
    const browser = await puppeteer.launch({ 
        headless: false,
        args: [
            '--window-size=800,600',
            '--disable-gpu',
            '--no-sandbox',
            '--disable-dev-shm-usage',
            '--disable-software-rasterizer'
        ]
    });
    const numAcordo = "235247368";
    const page = await browser.newPage();
    await page.setViewport({ width: 800, height: 600 });

   //Begin navigation. Go to the URL, type login and password, press enter and login
    await page.goto('https://www.santandernegocios.com.br/portaldenegocios/#/externo');
    
    await page.waitForSelector('#userLogin__input'); 
    await page.waitForSelector('#userPassword__input'); 
    await page.type('#userLogin__input', 'EX108593'); 
    await page.type('#userPassword__input', '@BARC02');  
   await page.focus('#userPassword__input');
   await page.keyboard.press('Enter')

   //Waiting until it finishes loading the page
    await page.waitForNavigation();

   
    await page.waitForSelector('input[name="inputSearch"]');
    await page.type('input[name="inputSearch"]', '32877625000122');
    await page.focus('input[name="inputSearch"]');
    await page.keyboard.press('Enter')
    await page.waitForNavigation();
    
   
   
   
 
   //Trying to reach the button
   await page.evaluate(() => {
    document.querySelector('div.avatar-letters').click();

    
});

await page.evaluate(() => {
    
    const sessionMenu = document.querySelector('div.session-menu');

    if (sessionMenu) {
        // Find the <ul> inside this <div>
        const ul = sessionMenu.querySelector('ul');

        if (ul) {
           
            const link = Array.from(ul.querySelectorAll('li a')).find(anchor => anchor.textContent.trim() === 'Acordo Pj' || anchor.textContent.trim() === 'Acordo Pf');

            if (link) {
                
                link.click();
            } else {
                console.error('Acordo pf or pj not found');
            }
        } else {
            console.error('No <ul> found');
        }
    } else {
        console.error('No session-menu div found');
    }
});

await page.waitForNavigation();


await page.evaluate(() => {
    document.querySelector('#accordioAcordosPendentes > div.accordion-tab > div > div > h4 > span.accordion-tab-button').click();

    
});
await page.waitForNavigation();
let accordions = document.querySelectorAll("div.accordion-tab-body")    
    console.log("qtos eu achei");
    console.log("n" + accordions.length)

/*
await page.evaluate(() => {
    console.log("clicking");
    let accordions = document.querySelectorAll("div.accordion-tab-body")    
    console.log("qtos eu achei");
    console.log("n" + accordions.length)
    accordions.forEach(accordion => {
        console.log(accordion)
    })
})
*/

/*
await page.evaluate(() => {
    // Find all spaui-datatable elements
    const datatables = Array.from(document.querySelectorAll('spaui-datatable'));

    // Log if any spaui-datatable elements are found
    if (datatables.length > 0) {
        console.log(`Found ${datatables.length} spaui-datatable elements.`);
        
        datatables.forEach((datatable, index) => {
            // Find the table element inside each spaui-datatable
            const table = datatable.querySelector('table');
            
            if (table) {
                console.log(`Table found in spaui-datatable element ${index + 1}`);
            } else {
                console.error(`No table found in spaui-datatable element ${index + 1}`);
            }
        });
    } else {
        console.error('No spaui-datatable elements found');
    }
});

*/

})();

Again, thanks for your attention.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật