1.0.1 • Published 1 year ago

playwrigh-cursor v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Simulate human mouse movement, clicking, and input using playwright.

Import

import {InitPlaywrightCursor} from "playwrigh-cursor";
//or
const {InitPlaywrightCursor} = require("playwrigh-cursor")

Use

const browser = await chromium.launch({
    executablePath: `C:/Program Files/Google/Chrome/Application/chrome.exe`,
    headless: false,
    args: [
        // "--disable-blink-features=AutomationControlled"
    ]
});
const page = await browser.newPage()
const cur = await InitPlaywrightCursor(page);
await page.goto("https://www.baidu.com/");
await cur.setInputText(page.locator(`#kw`),"123456")
await page.waitForTimeout(1000*2)
await cur.click(page.locator(`#su`))
await cur.click(page.locator(`.result-op.c-container.new-pmd a`).last())

Functions

cur.randomMove
curl.slide
curl.click
curl.fill
curl.setInputText
curl.clearInputText