The loginLinkedIn
function logs a user into LinkedIn using the enterLinkedIn
function, which retrieves login credentials from a hardcoded JSON file and uses Selenium to fill in the login form. The loginLinkedIn
function does not check if the login was successful, it only checks if the user is logged in, and the enterLinkedIn
function does not handle errors robustly.
The listConnections
function is an asynchronous module that retrieves a list of unique LinkedIn connections' URLs by utilizing Selenium to navigate to the user's my network page, check for login status, and retrieve connections until at least 10 unique connections are found. If no driver is provided, it creates a new instance using getClient()
and logs in to LinkedIn using loginLinkedIn()
, before proceeding with the connection retrieval process.