Files
puppeteerjs/main.js
T
2022-09-05 00:19:54 +02:00

33 lines
1.0 KiB
JavaScript

const {_android: android} = require('playwright');
const RDV_URL = "https://rendezvousparis.hermes.com/client/register";
// const RDV_URL = "https://bot.sannysoft.com/";
(async () => {
// Connect to the device.
const [device] = await android.devices();
console.log(`Model: ${device.model()}`);
console.log(`Serial: ${device.serial()}`);
// Take screenshot of the whole device.
await device.screenshot({path: 'device.png'});
{
// --------------------- Browser -----------------------
// Launch Chrome browser.
await device.shell('am force-stop com.android.chrome');
const context = await device.launchBrowser({command: '--incognito'});
// Use BrowserContext as usual.
const page = await context.newPage();
await page.goto(RDV_URL);
console.log(await page.evaluate(() => window.location.href));
await page.screenshot({path: 'page.png'});
await delay(50000);
await context.close();
}
// Close the device.
await device.close();
})();