Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this still maintained? #92

Open
lmtr0 opened this issue Feb 19, 2024 · 5 comments
Open

Is this still maintained? #92

lmtr0 opened this issue Feb 19, 2024 · 5 comments

Comments

@lmtr0
Copy link

lmtr0 commented Feb 19, 2024

Hi there, I'm considering this project for a production product, is this still maintained?

@jimmont
Copy link

jimmont commented Aug 6, 2024

deno-puppeteer is no longer needed as npm support made it unnecessary, this works, however note the comment about an error below in the working sample where in my current use it fails half the time;

/* deno test -A puppet.js
deno.json
{ "nodeModulesDir": "auto" }
 */
import puppeteer from 'npm:puppeteer-core';
import { assert } from "jsr:@std/assert";

const browser = await puppeteer.launch({
  slowMo: 250,
  devtools: true,
  executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
});

const [page] = await browser.pages();

const gotoResult = await page.goto('https://deno.com').catch((err) => err);
if (gotoResult instanceof Error) {
/* 2024-11
problem with error "Not implemented: ClientRequest.options.createConnection"
https://github.com/denoland/deno/issues/19507
*/
  const { message = '?!' } = gotoResult;
  console.error(`error... "${message}" ${
  	message.includes('detached') ? 'see https://github.com/denoland/deno/issues/19507' : ''
  }`);
  await browser.close();

  Deno.exit(1);
}

const text = await page.evaluate(() => {
	return document.body.querySelector('main h1')?.textContent ?? '';
});

console.log({text});

Deno.test('test stuff', async ()=>{
	assert(text.includes('JavaScript'), 'has JavaScript');
});

await browser.close();

previously:
because it appears this repo is no longer maintained I moved to Astral at https://github.com/lino-levan/astral
a quick demo seems to work:

import { launch } from "jsr:@astral/astral";
const browser = await launch({
	headless: false,
	path: '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
});
const page = await browser.newPage("https://deno.com");
const screenshot = await page.screenshot();
Deno.writeFileSync("screenshot.png", screenshot);
await browser.close();

now moving on to do something useful with it... hope this helps

@lmtr0
Copy link
Author

lmtr0 commented Aug 6, 2024

thx

@lmtr0 lmtr0 closed this as completed Aug 6, 2024
@ooker777
Copy link

I would leave this issue open. This would provide it more visibility I guess

@lmtr0
Copy link
Author

lmtr0 commented Nov 11, 2024

I gues so, but I would recommend people to move to the official Puppeteer library as deno supports NPM now

@lmtr0 lmtr0 reopened this Nov 11, 2024
@ooker777
Copy link

Isn't that it has always been supporting npm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants