Never Log In Again: Reusing User Profiles

One of the best thing about any modern browser is that it can save your login details and such so that you don't need to keep logging into it time and again. Too bad that it seems to stop working when we get to the browser automation world. This gets worse if you have to access something with MFA. But what if we could get that same login-saving functionality here? We can do exactly this with user data profiles that we can save and reuse. So let's explore some ways to do exactly this


Getting Started

First things first, let's get your environment set up. Grab these packages:

yarn add puppeteer # Process will be quite similar for playwright as well

Using profiles locally

We'll be testing this with https://www.scrapingcourse.com/dashboard as an example. Setting up the profile is quite simple,

Now that we have the profile set up, we can use it to login automatically.

And voila! We've logged in automatically and scraped the page. No need to keep logging in manually.


Using profiles with Hyperbrowser

Now let's see if we can make it even easier and more scalable with Hyperbrowser.

First, lets install the @hyperbrowser/sdk package.

yarn add @hyperbrowser/sdk

Now, head over to your Hyperbrowser dashboard, to get your API key. Once you have it, you can use it to create a client.

And that's it! We've created a profile and started a session. You can now reuse the same profile to scrape the page using this id.

Why use Hyperbrowser for this?

There's a few reasons why you might want to use Hyperbrowser for this.

  1. Security:
    • Hyperbrowser provides you with a live URL that can be sent to anyone you want. No need to worry about credentials sharing.
    • All data at rest is encrypted, so you can rest easy knowing that your credentials are safe.
  2. Scalability: You can create multiple sessions with the same profile and use them as needed.
  3. Consistent: Hyperbrowser only updates the profile when you tell it to. This means that you can reuse the same profile for different purposes without having to worry about it being changed.

Wrapping Up

Look at what we've built here - one login, endless reuse. That makes it a lot easier to automate things like scraping, form filling, and more.

Ready to make your automation life easier? Grab Hyperbrowser and give it a shot!

Hyperbrowser

Start building today

Launch your browser in seconds. No credit card required.