Reusing virtual browser profiles

  • Created

We recommend that you read the Getting started with Kameleo Automation article before reading this one.

Using the same browsing context as before, such as your browsing history, cookies, passwords, and session data, can make your job easier by letting websites think you’re a returning user and not a bot.

Save yourself the trouble of having to log in every time you want to use one of your online accounts. Just stay logged in all the time with Kameleo's virtual browser profiles. They are stored automatically in Kameleo's workspace folder, so you can reload them at any time. If you would like to use the virtual browser profiles on another PC you can export them into a .kameleo file. These files can easily be transferred to any other Kameleo user, and they can continue working in the “same browser” by loading back the same .kameleo file.

  • await client.stopProfile(profile.id);
    await client.exportProfile(profile.id, { body: { path: `${__dirname}\\test.kameleo` } });
    await client.deleteProfile(profile.id);
    profile = await client.importProfile({ body: { path: `${__dirname}\\test.kameleo` } });
    await client.startProfile(profile.id);

    See the full example here.

  • await client.StopProfileAsync(profile.Id);
    await client.ExportProfileAsync(profile.Id, new SaveProfileRequest(Path.Combine(Environment.CurrentDirectory,"test.kameleo")));
    await client.DeleteProfileAsync(profile.Id);
    profile = await client.ImportProfileAsync(new LoadProfileRequest(Path.Combine(Environment.CurrentDirectory, "test.kameleo")));
    await client.StartProfileAsync(profile.Id);

    See the full example here.

  • import os
    
    client.stop_profile(profile.id)
    path = f'{os.path.dirname(os.path.realpath(__file__))}\\test.kameleo'
    client.export_profile(profile.id, body=ExportProfileRequest(path=path))
    client.delete_profile(profile.id);
    profile = client.import_profile(body=ImportProfileRequest(path=path))
    client.start_profile(profile.id)

    See the full example here.

Was this article helpful?

0 out of 1 found this helpful