0

I have this link element:

<a class="a-link-normal s-underline-text s-underline-link-text s-link-style a-text-normal" href="URL"><span class="a-size-medium a-color-base a-text-normal">some text</span> </a>

I am using the following in puppeteer to try and extract the href and push it to an array but having no luck, what am I doing wrong?

let URL = await page.evaluate(() => Array.from(document.querySelectorAll(
  '.a-link-normal s-underline-text s-underline-link-text s-link-style a-text-normal'
), e => e.getAttribute('href')));
URLS.push(URL)
ggorlen
  • 44,755
  • 7
  • 76
  • 106
Kieran
  • 67
  • 10
  • 4
    Your CSS selector is wrong. There should be periods between classes here, `.a-link-normal.s-underline-text.s-underline-link-text.s-link-style.a-text-normal` – ggorlen Aug 31 '22 at 15:15

0 Answers0