Hey y’all,
I’m trying to figure out how to use waitForSelector Puppeteer get all p tags on a page. Like, I want to make sure the page is fully loaded before grabbing all the `<p>` elements.
I tried something like:
```javascript
await page.waitForSelector('p');
const paragraphs = await page.$$('p');
```
But idk if this is the *best* way or if I’m missing something.
Also, what if the page has dynamic content? Will waitForSelector Puppeteer get all p tags even if they load later? Or do I need to handle that differently?
Any tips or examples would be super helpful! Thanks in advance
I’m trying to figure out how to use waitForSelector Puppeteer get all p tags on a page. Like, I want to make sure the page is fully loaded before grabbing all the `<p>` elements.
I tried something like:
```javascript
await page.waitForSelector('p');
const paragraphs = await page.$$('p');
```
But idk if this is the *best* way or if I’m missing something.
Also, what if the page has dynamic content? Will waitForSelector Puppeteer get all p tags even if they load later? Or do I need to handle that differently?
Any tips or examples would be super helpful! Thanks in advance
