const puppeteer = require('puppeteer-core');
(async () => {
const token = 'your_token_here';
const profileId = 'your_profile_id'; // Remove this line if you want to create a new profile
const cloudBrowserUrl = `https://cloudbrowser.gologin.com/connect?token=${token}${profileId ? `&profile=${profileId}` : ''}`;
const browser = await puppeteer.connect({
browserWSEndpoint: cloudBrowserUrl,
defaultViewport: null
});
const page = await browser.newPage();
await page.goto('https://example.com');
const title = await page.title();
console.log('Page title:', title);
await page.screenshot({ path: 'screenshot.png' });
await browser.close();
})();