Cua Docs

Export contacts overnight

Extract LinkedIn or X contacts overnight from a logged-in browser session into a clean CSV.

After a networking event, use Cua Driver on the machine where you already have a logged-in browser. The agent inherits that real authenticated session from the browser profile, so there are no credentials in the script and no anti-bot fight. Let it run overnight, then wake up to a CSV.

Before you start: install Cua Driver, grant host permissions, connect your agent, and configure Keep Cua Driver running.

Log in once#

On your own machine, open the browser profile that Cua Driver will drive and log into LinkedIn, X, or both. Do the normal login yourself, including any two-factor prompts. The session persistence is the whole trick: the overnight job starts from a browser that is already authenticated.

Keep the machine awake for the whole run. Disable sleep, leave the browser profile available, and keep the network connection up so the overnight run does not pause.

Give the overnight task#

Ask the agent for the exact extraction you want. For LinkedIn, start from the connections page and cap the run with a clear N while you test:

Using cua-driver, open the browser to https://www.linkedin.com/mynetwork/invite-connect/connections/ .
 
For each of the first 50 connections:
1. Open the profile.
2. Read first name, last name, role, company, and profile URL.
3. Append one row to ~/contacts.csv.
4. Set met_at to "Google Devfest Toronto" for every row.
 
Use this CSV header:
first,last,role,company,met_at,linkedin
 
If a value is missing, leave that field empty and keep going.

The agent will use page for browser navigation, then click, type_text, and get_window_state to inspect and drive the browser. It may call list_windows first if more than one browser window is open.

Cua Driver does not expose a filesystem write tool. The agent writes ~/contacts.csv by driving an app that can write files, for example a terminal running shell commands or a text editor with the CSV open.

Let it run#

Kick off the task before you leave. In the morning, open ~/contacts.csv and spot-check the rows before importing them into a CRM or email tool.

Scale this out#

One logged-in browser profile handles one account at a time. To process many accounts, events, or platforms in parallel overnight, move each authenticated session into its own Cua Sandbox cloud desktop. Log in once per sandbox, persist the session in the image, then fan the jobs out.

Use Run sandboxes in parallel to run many desktops at once, Images to bake the logged-in session into an image, and Your first cloud sandbox for the basic SDK lifecycle.