Xetera / ghost-cursor

🖱️ Generate human-like mouse movements with puppeteer or on any 2D plane
MIT License
1.03k stars 120 forks source link

Usage of puppeteer-core with ghost-cursor #97

Closed photorealisticbeaver closed 4 months ago

photorealisticbeaver commented 1 year ago

Starting on puppeteer 19, PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true seems to be ignored, so it would be quite handy to be able to use puppeteer-core with ghost-cursor

alvinlys commented 7 months ago
import puppeteer from 'puppeteer-core'
import ghostCursor from 'ghost-cursor'

(async () => {
    const browser = await puppeteer.connect({
        browserURL,
    })
    const [page] = await browser.pages()
    const cursor = ghostCursor.createCursor(page)

    await cursor.click(selector)
})();

perhaps try this ^ ?

Niek commented 4 months ago

I think the env variables is now PUPPETEER_SKIP_DOWNLOAD=1.

As for puppeteer-core, it should work as well.