mercredi 12 juin 2019

How to get text inside tag without the link in href, with Puppeteer

I am trying to scrape some date inside an tag, but I do not want to get the link that is inside it.

Not really sure how to approach the problem since the tags do not have ID's or classes

<div id="list-section">
   <ul>
    <li data-store-id="1234">
      <div class="item">
       <p>
        <strong>
          <a target="_blank" href="www.somelink.com"> NAME ONE </a>
        </strong>
       </p>
      </div>
     </li>
</div>
 <li data-store-id="1234">
  <div class="item">
   <p>
    <strong>
      <a target="_blank" href="www.somelink.com"> NAME TWO </a>
    </strong>
   </p>
  </div>
 </li>
</ul>

I am trying to have every name in an array at the end [NAME ONE, NAME TWO] etc.

Edit: using node with puppeteer

Aucun commentaire:

Enregistrer un commentaire