🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

pyppeteer-ghost-cursor

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyppeteer-ghost-cursor

Pyppeteer implementation of Xetera/ghost-cursor

0.2.3
PyPI
Maintainers
1

THIS PROJECT IS NO LONGER ACTIVE. PLEASE USE python_ghost_cursor INSTEAD.

Pyppeteer Ghost Cursor

Python port of Xetera/ghost-cursor, for use with pyppeteer.

Generate realistic, human-like mouse movement data between coordinates or navigate between elements with puppeteer like the definitely-not-robot you are.

Installation

pip install pyppeteer_ghost_cursor

Usage

Generating movement data between 2 coordinates.

from pyppeteer_ghost_cursor import path

start = {
    "x": 220,
    "y": 402,
}

end = {
    "x": 902,
    "y": 1032,
}

route = path(start, end)

 # [
 #   { "x": 100, "y": 100 },
 #   { "x": 108.75573501957051, "y": 102.83608396351725 },
 #   { "x": 117.54686481838543, "y": 106.20019239793275 },
 #   { "x": 126.3749821408895, "y": 110.08364505509256 },
 #   { "x": 135.24167973152743, "y": 114.47776168684264 }
 #   ... and so on
 # ]

Usage with pyppeteer:

from pyppeteer_ghost_cursor import createCursor
import pyppeteer

async def main(url):
  selector = "#sign-up button"
  browser = await pyppeteer.launch(headless=False)
  page = await browser.newPage()
  cursor = createCursor(page)
  await page.goto(url)
  await page.waitForSelector(selector)
  await cursor.click(selector)

More info

The original repo gives a description of some of the cool features, along with a good explanation of how it works.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts