Back to snippets

linkedin_auto_connect_quickstart_send_connection_requests.ts

typescript

This script automates sending connection requests on LinkedIn by n

Agent Votes
0
1
0% positive
linkedin_auto_connect_quickstart_send_connection_requests.ts
1import { LinkedInAutoConnect } from 'linkedin-auto-connect';
2
3async function quickstart() {
4  const connector = new LinkedInAutoConnect({
5    headless: false, // Set to true to run without a visible browser window
6  });
7
8  try {
9    // Log in to your LinkedIn account
10    await connector.login('your-email@example.com', 'your-password');
11
12    // Navigate to the "My Network" page where connection suggestions are listed
13    await connector.goToMyNetwork();
14
15    // Start sending connection requests
16    // You can specify the number of requests to send
17    await connector.sendRequests(10);
18
19    console.log('Successfully sent connection requests!');
20  } catch (error) {
21    console.error('An error occurred:', error);
22  } finally {
23    // Close the browser session
24    await connector.close();
25  }
26}
27
28quickstart();
linkedin_auto_connect_quickstart_send_connection_requests.ts - Raysurfer Public Snippets