I'm working on a project at the moment, have run into an error and need your help!
Basically, I am trying to select the wrapped text inside the following anchor tag
<a href="..." class="productDetailsLink js-productName">Product Name</a>
This is my current code:
await page.waitForSelector('div > div > div > div > div > a[class = "productDetailsLink js-productName"')
.then(() => page.evaluate(() => {
const itemArray = [];
const itemNodeList = document.querySelectorAll('div > div > div > div > div > a[class = "productDetailsLink js-productName"');
itemNodeList.forEach(item => {
const itemTitle = item.querySelectorAll('div > div > div > div > div > a[class = "productDetailsLink js-productName"').innerText;
console.log(itemTitle);
})
} ))
However, I'm not getting any luck. I've run out of ideas on how to scrape such text.