Puppeteer, how to select button which has no id

Very new to puppeteer & javascript, and I have no JSON experience at all. I’m trying to select the following button:

<button style=SomeColorInfo class=LongListOfClassNames type="button" role="button">
    <span>visible text</span>
</button>

(I have indications that the site already knows it’s being scraped, so I’d rather not publicise the URL or specific details of the code unless necessary.)

I can select the button using (a very long) xpath, but this seems risky as it ties my code to the particular structure of the DOM. Since the page doesn’t have many buttons, and the text in the <span> is extremely unlikely to ever change, I’d prefer that the code look for a button with that text.

There’s no scrolling or next-page issues to take care of; this page is finite. I’m just banging my head against a brick wall trying to get the button selected!

I have tried each of the following in turn:

const theB = await page.locator('button');
const theB = await page
    .locator('button')
    .filter(button => button.innerText === 'visible text');
const theB = await page
    .locator('button')
    .filter(button => button.innerText == 'visible text');
const theB = await page
    .locator('button')
    .filter(button => button.innerText = 'visible text');
const theB = await page
    .locator('button')
    .filter(button => button.innerText.startsWith('visible'));
const theB = await page
    .locator('button')
    .filter(button => button.innerText.contains('visible'));
const theB = await page
    .locator('button')
    .filter(button => button.innerHTML.contains('visible'));
const theB = await page.locator('::-p-aria([role="button"])');

Most of these have been inspired by threads in here. None are working. Each time I get undefined from console.log(theB.innerHTML);

(In case it makes a difference, the end goal is to click this button. Since I wasn’t managing to achieve that I backed off slightly, to just get it selected and then read out its html.)

Can someone please point me in the right direction of solving this seemingly basic problem? Many thanks!