Reputation:
i was creating a certain code of puppeteer ,and i wanted to know if there's a way to get innertext or innerHtml or textcontent while using puppeteer without an async function.
Upvotes: 0
Views: 206
Reputation: 181
You can use await
to use an async function in a synchron way.
Please note that this does not only apply to puppeteer, but javascript in general.
var text = await page.evaluate(() =>
document.querySelector('#example').innerHTML
);
Upvotes: 1