playwrigh-cursor
v1.0.1
Published
Simulate human mouse movement, clicking, and input using playwright.
Downloads
5
Maintainers
Readme
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