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

Overhaul documentation #13

Closed
Niek opened this issue Nov 13, 2020 · 6 comments
Closed

Overhaul documentation #13

Niek opened this issue Nov 13, 2020 · 6 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Niek
Copy link
Collaborator

Niek commented Nov 13, 2020

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

  • Example of installMouseHelper
  • New function signature for createCursor
  • New function signature for move and click
  • Document moveTo and getRandomPagePoint

Anybody who's willing to check this?

@Niek Niek added help wanted Extra attention is needed good first issue Good for newcomers labels Nov 13, 2020
@Niek
Copy link
Collaborator Author

Niek commented Feb 17, 2021

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
Copy link

@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
Copy link
Collaborator Author

Niek commented Apr 19, 2021

@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
Copy link

clouedoc commented Dec 1, 2021

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

  • Document the fact that the cursor supports XPath

@TheGP
Copy link
Contributor

TheGP commented Feb 3, 2024

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

@Niek
Copy link
Collaborator Author

Niek commented Feb 4, 2024

Fixed in #116

@Niek Niek closed this as completed Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants