79631964

Date: 2025-05-21 12:29:43
Score: 0.5
Natty:
Report link

If your labels are siblings of data value, you may use getByText and specify the next span with a + in the locator.

For example

const html = `
  <span>Bescheid</span>
  <span> 2010 </span>
`
await page.setContent(html);

const text = await page.getByText('Bescheid').locator('+ span').textContent();
expect(text).toBe(' 2010 ');

enter image description here

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
Posted by: Leta Waldergrave