as second part on my last topic: WordPress use puppeteer as a plugin I want to ask how I can run puppeteer web framework in wordpress plugin. I add all files from puppeteer web in plugin core, but always not working. I want to run jquery script, that will run click functions on other site, collect some info and send them back to me.
if this can be done with jquery snippet or something else, I will be very happy to know it. Thanks!
My code for puppeteer web:
add_action('wp_footer', 'some_info222');
function some_info222() {
?>
<script src="https://unpkg.com/puppeteer-web">
</script>
<script>
const browser = await puppeteer.connect({
browserWSEndpoint: `ws://0.0.0.0:8080`, // <-- connect to a server running somewhere
ignoreHTTPSErrors: true
});
const pagesCount = (await browser.pages()).length;
const browserWSEndpoint = await browser.wsEndpoint();
console.log({ browserWSEndpoint, pagesCount });
</script>
<?php
}