1

how can i get content of #document in iframe with puppeteer or cheerio or in any other javascript way?

website html goes on like below

i want to get all the texts in span tag Please teach me how to do this I found for solution so hard, but I couldn't find a way

website address is maybe "https://example.com/20220314#"

<div class="viewWrap">
 <div class="contWrap">
  <iframe id="ifrm" src="/report/viewer/do?rcpNo=20023003&dcmNo=2992309.xsd">
   #document
   <html>
    <head></head>
    <body>
     <p>
      <span> Please teach me </span>
      <span> How to do this </span>
     </p>
    </body>
   </html>
  </iframe>
 </div>
</div>
T TS
  • 11
  • 1
  • 2
    Just load the url in the src attribute: `/report/viewer/do?rcpNo=20023003&dcmNo=2992309.xsd` – pguardiario Mar 14 '22 at 01:50
  • See also [How to select elements within an iframe element in Puppeteer](https://stackoverflow.com/questions/56420047/how-to-select-elements-within-an-iframe-element-in-puppeteer) – ggorlen Sep 01 '23 at 20:13

0 Answers0