Xetera / ghost-cursor

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

Overhaul documentation #13

Closed Niek closed 9 months ago

Niek commented 3 years ago

The README needs some updating to reflect the changes in the code recently:

Anybody who's willing to check this?

Niek commented 3 years ago

Sample TS code:

import * as puppeteer from 'puppeteer'
import { createCursor, getRandomPagePoint, installMouseHelper } from 'ghost-cursor'

(async () => {
  const browser = await puppeteer.launch()
  const page = await browser.newPage()
  const cursor = createCursor(page, await getRandomPagePoint(page), true)
  await installMouseHelper(page) // this shows the trace
  page.goto('https://www.example.com/')
  await cursor.click('element', { waitForClick: 10000, waitForSelector: 1000, paddingPercentage: 20 })
})()
Somberor commented 3 years ago

@Niek how can the speed of the mouse movement be set? Sometimes it goes too fast and I would like it to have some minimum Thank you for the great implementation!

Niek commented 3 years ago

@Niek how can the speed of the mouse movement be set? Sometimes it goes too fast and I would like it to have some minimum Thank you for the great implementation!

This can be changed in the path() function - if you want to add speed customization, feel free to open a PR.

clouedoc commented 2 years ago

I'd like to add an item to the list:

TheGP commented 9 months ago

I generated some docs with ChatGPT, wanna see what you'll think :)

Niek commented 9 months ago

Fixed in #116