I am looking for a way to efficiently scrape information formatted in the following way using puppeteer. Suppose I have a list of things on a website divided as such:
<div id="list">
<div class="item" pos="0">
<a href="www.somewebsite.com">
<div class="nameToRetrieve"> Name 1 </div>
</div>
<div class="item" pos="1">
<a href="www.somewebsite.com">
<div class="nameToRetrieve"> Name 2 </div>
</div>
<div class="item" pos="2">
<a href="www.somewebsite.com">
<div class="nameToRetrieve"> Name 3 </div>
</div>
</div>
How can I retrieve the information of the names (Name 1, Name 2 and Name 3?
I have tried fitting them into an object to make then into an array, but I am still confused as to how to approach it.
const listOfStuff = document.getElementById('list').getElementsByClassName('itemResult')