具体代码如下
const puppeteer = require('puppeteer');
(async()=>{
const browser = await puppeteer.launch({
headless: false
});
const page = await browser.newPage();
const mouse = await page.mouse;
await page.goto('https://www.XXX.com');
await page.type('#txtUserName', 'sa', {
delay: 250
});
await page.tap('#btnLoginNew');
await page.waitFor(2000);
const dimensions = await page.evaluate(()=>{
return {
left: document.getElementsByClassName('scheduling-item')[0].offsetLeft,
top: document.getElementsByClassName('scheduling-item')[0].offsetTop
}
})
await mouse.move(dimensions.left, dimensions.top); // 这句应该使用什么方法?
})();